[英]No able to run pm2 on Windows server 2012
I installed pm2
on Windows server 2012我在 Windows server 2012 上安装了
pm2
npm install pm2 -g
I closed my PowerShell and opened it again.我关闭了我的 PowerShell 并再次打开它。
When I try to run pm2
it fails with this error当我尝试运行
pm2
失败并出现此错误
> 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我注意到
PM2_HOME
没有设置,所以我将它设置为我的主目录中的.pm2
,但这没有帮助
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.在一台 Windows 2012R2 服务器 PM2 上出现同样的问题,而另一台没有。 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.添加路径并重新启动服务器 PM2 后,在 PowerShell 和 CMD 中被识别。
There is no need to add PM2 path to the System variables.
无需将 PM2 路径添加到系统变量。
There is Bountysource fundraising to make PM2 compatible with Windows:有 Bountysource 筹款使 PM2 与 Windows 兼容:
which means that currently it is not completely compatible.这意味着目前它并不完全兼容。
See also this issue:另请参阅此问题:
with this comment from Unitech:来自 Unitech 的评论:
PM2 is a production module, who should be mainly used on Linux servers.
PM2是一个生产模块,应该主要用在Linux服务器上。 I haven't tried it on other platforms than Linux.
除了Linux,我还没有在其他平台上尝试过。
只需在全局模式下安装 pm2
npm install pm2 -g -s
The issue can be resolved by adding the path of npm to the env setting.可以通过将 npm 的路径添加到 env 设置来解决该问题。 At least that did the trick for me.
至少这对我有用。
Here How to solve it:这里如何解决它:
Try to execute again.尝试再次执行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.