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

aksanoble picture aksanoble · Jul 25, 2016 · Viewed 9.5k times · Source

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.

Answer

hunterloftis picture hunterloftis · Jul 25, 2016

Yes:

$ heroku run npm run refresh