Search code examples
node.jspm2

PM2 downloads in idea are complete but can't start


npm install pm2 -g

pm2 downloads have been successful, but it's always impossible to start. The input (PM2 start app.js) is reported as follows: 'pm2' is not an internal or external command, nor is it a running program.

I hope to help me solve it. Thank you.


Solution

  • It looks like pm2 is not on your path. Most likely, your entire node global install directory is not on your path. What you need to do is the following:

    1. Determine where the node global install location is. It looks like you are on windows, so it might be something like C:\Program Files\nodejs\bin. I am not sure though, so you need to find it yourself.
    2. Add this folder to your PATH. See this answer on how to do it.

    Then you should be able to launch pm2 from any command prompt.