Skip to content
Latchkey

Sequelize/Umzug Migration "ENOENT: no such file or directory" in CI

Sequelize-cli (which uses Umzug) tried to read the migrations directory and got ENOENT. The configured migrations path does not exist in the CI checkout, so no migrations can be loaded. This is deterministic.

What this error means

sequelize-cli db:migrate fails with "ENOENT: no such file or directory" pointing at a migrations path, or silently applies nothing because the folder is wrong. It happens when .sequelizerc/config paths do not match the repo layout in CI.

psql
Error: ENOENT: no such file or directory, scandir
'/home/runner/work/app/app/dist/migrations'

Common causes

Wrong migrations path

The migrations-path in .sequelizerc/config points at a directory that does not exist in CI (e.g. a dist/ folder that was not built).

Migrations not compiled/copied

If migrations are compiled or copied during build, skipping that step leaves the configured directory empty or absent.

How to fix it

Point sequelize-cli at the correct directory

Set the migrations path to where the files actually are in CI.

.sequelizerc
// .sequelizerc
const path = require('path');
module.exports = {
  'migrations-path': path.resolve('src', 'migrations'),
};

Build or copy migrations before running

  1. If migrations are compiled, run the build before db:migrate.
  2. Ensure the migrations folder is included in the checkout/build output.
  3. Verify the path resolves with a quick ls in CI.

How to prevent it

  • Keep migrations-path aligned with the actual repo/build layout.
  • Build or copy migrations before invoking sequelize-cli in CI.
  • This is deterministic - retrying with the wrong path loads no migrations.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →