I'm trying to re-deploy an old project to Heroku and running into the error: Unable to resolve sequelize package in /app
after pushing, then running the command heroku run npx sequelize-cli db:migrate
.
FWIW, I haven't made any changes to the repo in the ~1 year since I last deployed it without issue. I recently added engines
to the package.json to resolve pushing errors, but that's the only change.
I also don't have a /app
directory in this repo, so I'm unsure where this is coming from.
My package.json:
{
"name": "backend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"sequelize": "sequelize",
"sequelize-cli": "sequelize-cli",
"start": "per-env",
"start:development": "nodemon -r dotenv/config ./bin/www",
"start:production": "node ./bin/www"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"cookie-parser": "^1.4.5",
"cors": "^2.8.5",
"csurf": "^1.11.0",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"express-async-handler": "^1.2.0",
"express-validator": "^6.13.0",
"faker": "^5.5.3",
"helmet": "^4.6.0",
"jsonwebtoken": "^8.5.1",
"morgan": "^1.10.0",
"per-env": "^1.0.2",
"pg": "^8.7.1",
"sequelize": "^5.22.4",
"sequelize-cli": "^5.5.1"
},
"engines": {
"node": "12.22.3"
},
"devDependencies": {
"dotenv-cli": "^4.1.0",
"nodemon": "^2.0.14"
}
}
This was fixed by running heroku run npm run sequelize-cli db:migrate