Database postgrator:迁移postgresql数据库时找不到

Database postgrator:迁移postgresql数据库时找不到,database,express,heroku,migration,migrate,Database,Express,Heroku,Migration,Migrate,错误: postgrator cli 4.0.0版安装在repo上,运行npm list postgrator cli告诉我这一点。但在我推到heroku之后,就好像postgrator不存在一样heroku run npm install postgrator cli和其他此类命令不会更改,heroku run npm list postgrator cli返回: $ heroku run npm run migrate Running npm run migrate on ⬢ shelly-

错误:

postgrator cli 4.0.0版安装在repo上,运行
npm list postgrator cli
告诉我这一点。但在我推到heroku之后,就好像postgrator不存在一样
heroku run npm install postgrator cli
和其他此类命令不会更改,
heroku run npm list postgrator cli
返回:

$ heroku run npm run migrate
Running npm run migrate on ⬢ shelly-moth-73910... up, run.3979 (Free)      

> noteful-app-server@1.0.0 migrate /app
> postgrator --config postgrator-config.js

sh: 1: postgrator: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! noteful-app-server@1.0.0 migrate: `postgrator --config postgrator-config.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the noteful-app-server@1.0.0 migrate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /app/.npm/_logs/2020-09-06T07_52_36_217Z-debug.log
这是我的
postgrator config.js

$ heroku run npm list postgrator-cli
Running npm list postgrator-cli on ⬢ rocky-garden-73910... up, run.7024 (Free)
noteful-app-server@1.0.0 /app
`-- (empty)

Procfile包含
web:node src/server.js

我刚才也有同样的错误

$ heroku run npm list postgrator-cli
Running npm list postgrator-cli on ⬢ rocky-garden-73910... up, run.7024 (Free)
noteful-app-server@1.0.0 /app
`-- (empty)
在我的
package.json
中,我发现它在我的
“devdependences”
中,而不是在我的
“dependences”

当我第一次安装它时,我运行了
npmipostgrator cli-D
,使它成为开发依赖项。当我尝试在没有
-D
的情况下再次安装它时,它什么也没做,所以我从我的
包.json
中删除了它


然后,我运行了
npmipostgrator cli
并检查了我的
package.json
,发现它在我的
依赖项中。我git添加、提交并推送到heroku,然后我运行了
heroku运行npm运行migrate
——成功了

谢谢你,这正是我的问题所在。唯一一个在线的地方被问到了!