I am trying to run a node api as a service but when I run the following command
C:\Windows\System32>pm2-service-install -n 0PM2
it asks the following question
Perform environment setup (recommended)?
I put yes but it stays there and does nothing
What could be the problem?
You can simply install the pm2
package.
npm install pm2 -g
Run the module that has your server
pm2 start app.js
If the above things are working fine, it shows your installation and configuration are correct. Now, use pm2
commands:
pm2 startup
follow the command from the o/p of above command
pm2 save
It seems you are using windows, you should use these steps:
pm2-installer
from here.npm run setup
npm run configure
npm run setup
Check here for more details.