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.
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"