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

Andrew Eisenberg
  • 26,698
  • 9
  • 84
  • 133
LuLu Xue
  • 1
  • 3

1 Answers1

1

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.

Andrew Eisenberg
  • 26,698
  • 9
  • 84
  • 133
  • Thank you very much, @Andrew Eisenberg. The environment configuration is wrong. What do I need to do to improve your reputation? – LuLu Xue Jul 15 '18 at 15:26