How should I use pm2 command for npm run dev

Vaibhav Kadam picture Vaibhav Kadam · Mar 20, 2017 · Viewed 10.6k times · Source

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.

Answer

zenny picture zenny · Jan 17, 2019

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"