xxxxxxxxxx
pm2 start npm --name "server" -- start
//server is npm script in package.json
// "scripts": {
// "test": "echo \"Error: no test specified\" && exit 1",
// "start": "node backend/server",
// "server": "nodemon backend/server",
// "client": "npm start --prefix frontend",
// }
xxxxxxxxxx
PM2 now supports npm start:
To assign a name to the PM2 process, use the --name option:
pm2 start npm --name "app name" -- start