How to run a npm script on a deployed Heroku NodeJS app

谁说胖子不能爱 提交于 2019-12-10 13:22:31

问题


Under scripts in package.json I have the following.

'refresh': node refresh db

Is there a way to trigger this particular npm script on a NodeJS app deployed on Heroku.


回答1:


Yes:

$ heroku run npm run refresh



回答2:


Per the Heroku Node.js Documentation, you can add pre and post install scripts. In addition, you can add scripts that can be triggered by environment variables.



来源:https://stackoverflow.com/questions/38571318/how-to-run-a-npm-script-on-a-deployed-heroku-nodejs-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!