Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I use pm2 command for npm run dev

Tags:

node.js

npm

pm2

I'm running my app using sudo npm run dev how should I use pm2 in order to run sudo npm run dev this command.

like image 835
Coderminion Avatar asked Mar 20 '17 19:03

Coderminion


2 Answers

The following works for me.

pm2 start "npm run dev" --name myAppName

Your app name will be myAppName

You can see the logs

pm2 logs "myAppName"
like image 83
zenny Avatar answered Sep 17 '22 12:09

zenny


Try this: sudo pm2 start npm -- dev

like image 20
bumbleshoot Avatar answered Sep 19 '22 12:09

bumbleshoot