我尝试将旧项目重新部署到Heroku,并在推送后遇到错误:Unable to resolve sequelize package in /app
,然后运行命令heroku run npx sequelize-cli db:migrate
。
FWIW,自从我上次没有问题地部署它以来,我在大约1年内没有对repo进行任何更改。我最近在package.json中添加了engines
来解决推送错误,但这是唯一的更改。
我也没有/app
目录在这个仓库,所以我不确定这是从哪里来的。
我的包。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"
}
}
字符串
1条答案
按热度按时间jgovgodb1#
已通过运行
heroku run npm run sequelize-cli db:migrate
修复此问题