How could I run node server.js -p
by pm2?
Scripts of my package.json
is like below,
"scripts": {
"dev": "node server.js",
"start": "node server.js -p"
},
When I execute npm start
everything work truly. But I want to run this command with pm2.
To do it when I run pm2 start npm -- start
, the process will add to the list of the pm2 but my app not run!
the correct command is
pm2 start server.js
or if you want to pass -p
to your app and a name
pm2 start server.js --name "my-server" -- -p