How to run npm script in a deployed Heroku NodeJS application

In scriptsin package.jsonI have the following.

'refresh': node refresh db

Is there a way to invoke this particular npm script in a NodeJS application deployed to Heroku.

+4
source share
2 answers

Yes:

$ heroku run npm run refresh
+10
source

In the Heroku Node.js Documentation, you can add scripts before and after installation. In addition, you can add scripts that may be caused by environment variables.

+1
source

Source: https://habr.com/ru/post/1649047/


All Articles