Reputation: 2043
In my package.json
file I have two scripts, start
and production
, start
script is for local development while production
script is for deployment. Using npm i would just do npm run production
but how do I do this with pm2
Upvotes: 7
Views: 12252
Reputation: 2043
I got it, the command is pm2 start npm --name=app-name -- run production
Upvotes: 8
Reputation: 2134
Install pm2
globally using npm i -g pm2
and then use pm2' command as follow:
pm2 start npm -- production
Upvotes: 0