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.
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
const path = require('path');
module.exports = {
'migrations-path': path.resolve('src', 'migrations'),
};Build or copy migrations before running
- If migrations are compiled, run the build before
db:migrate. - Ensure the migrations folder is included in the checkout/build output.
- Verify the path resolves with a quick
lsin CI.
How to prevent it
- Keep
migrations-pathaligned 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.