I installed pm2
on Windows server 2012
npm install pm2 -g
I closed my PowerShell and opened it again.
When I try to run pm2
it fails with this error
> pm2 list
pm2 : The term 'pm2' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ pm2 list
+ ~~~
+ CategoryInfo : ObjectNotFound: (pm2:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I noticed PM2_HOME
was not set, so I set it to my .pm2
in my home directory, but that didn't help
Any pointers?
What is interesting, is that I have it working on another account on the same machine.
Had the same problem on one Windows 2012R2 server PM2 was working and the other one not. In the Environment there was no path to
C:\Users\USERNAME\AppData\Roaming\npm
After adding the path and a restart of the server PM2 was recognized in PowerShell and CMD.
There is no need to add PM2 path to the System variables.
There is Bountysource fundraising to make PM2 compatible with Windows:
which means that currently it is not completely compatible.
See also this issue:
with this comment from Unitech:
PM2 is a production module, who should be mainly used on Linux servers. I haven't tried it on other platforms than Linux.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With