pm2 is not recognised

Asked

Viewed 516 times

0

After giving the command

npm i -g pm2

When close and open cmd and type pm2 to test

He says that:

'pm2' is not recognised as an internal or external command, a operable program or a batch file

How to get pm2 recognized?

The installed Node is 10.12.0

  • Tried to close and open the terminal again? Restarted the machine and tried to install again? Not even with sudo works right? Regarding the version of Node, although I believe it does not interfere, is there a reason to be in an older version?  If not, maybe it is interesting also always keep in one of the latest versions.

  • I closed and opened the terminal, restarted the server, without how Adm worked. Actually, it was in version 10, because it was at the time I installed it. It was only after I added the path of node_modules,bin in the path

1 answer

0


What I tried to:

  • I closed and opened
  • I restarted the server
  • I tried as an administrator

None of it worked:

I realized that I had a node_modules folder in my drive where Apis are located

C\node-pm2\node_modules

Inside that folder is the folder . bin pm2

If I run the pm2 command inside it pm2 works. Then I copied the address above C\node-pm2\node_modules and added PATH to the environment variables and worked

Now I don’t understand why using the command npm i -g pm2 didn’t work

Browser other questions tagged

You are not signed in. Login or sign up in order to post.