Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using PM2 to run other npm scripts

Tags:

node.js

npm

pm2

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

like image 865
lulliezy Avatar asked Apr 09 '18 06:04

lulliezy


1 Answers

I got it, the command is pm2 start npm --name=app-name -- run production

like image 97
lulliezy Avatar answered Sep 28 '22 10:09

lulliezy