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

Issue

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.

Solution

Yes:

$ heroku run npm run refresh

Answered By – hunterloftis

Answer Checked By – Gilberto Lyons (AngularFixing Admin)

Leave a Reply

Your email address will not be published.