【问题标题】:No able to run pm2 on Windows server 2012无法在 Windows server 2012 上运行 pm2
【发布时间】:2019-11-13 08:20:15
【问题描述】:

我在 Windows server 2012 上安装了pm2

npm install pm2 -g

我关闭了我的 PowerShell 并再次打开它。

当我尝试运行 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

我注意到 PM2_HOME 未设置,因此我将其设置为我的主目录中的 .pm2,但这没有帮助

任何指针?

有趣的是,我让它在同一台机器上的另一个帐户上工作。

【问题讨论】:

    标签: node.js npm pm2


    【解决方案1】:

    在一台 Windows 2012R2 服务器上遇到同样的问题 PM2 工作正常,而另一台没有。 在环境中没有通往

    的路径

    C:\Users\USERNAME\AppData\Roaming\npm

    添加路径后,在 PowerShell 和 CMD 中识别出服务器 PM2 的重新启动。

    系统变量无需添加 PM2 路径。

    【讨论】:

    【解决方案2】:

    有 Bountysource 筹款让 PM2 与 Windows 兼容:

    表示目前不完全兼容。

    另请参阅此问题:

    来自 Unitech 的评论:

    PM2 是一个生产模块,应该主要用在 Linux 服务器上。除了 Linux,我还没有在其他平台上尝试过。

    【讨论】:

    • 顺便说一句,我让它在同一台机器上的另一个用户帐户上工作,它工作正常。
    【解决方案3】:

    只需在全局模式下安装 pm2

    npm install pm2 -g -s
    

    【讨论】:

      猜你喜欢
      • 2019-09-17
      • 1970-01-01
      • 2018-03-16
      • 1970-01-01
      • 2014-04-16
      • 1970-01-01
      • 2012-09-11
      • 1970-01-01
      • 2018-10-24
      相关资源
      最近更新 更多