【问题标题】:error while installing pm2 - node js安装 pm2 时出错 - node js
【发布时间】:2015-03-17 18:25:45
【问题描述】:

我正在尝试安装 pm2 (https://github.com/Unitech/pm2)

我收到此错误:

D:\_Work>npm install pm2
 -g --unsafe-perm
npm WARN `git config --get remote.origin.url` returned wrong result (http://ikt.
pm2.io/ikt.git) undefined
npm WARN `git config --get remote.origin.url` returned wrong result (http://ikt.
pm2.io/ikt.git) undefined
npm ERR! git clone http://ikt.pm2.io/ikt.git undefined
npm ERR! git clone http://ikt.pm2.io/ikt.git undefined
npm WARN optional dep failed, continuing ikt@git+http://ikt.pm2.io/ikt.git#maste
r
npm WARN optional dep failed, continuing fsevents@0.3.5
C:\Users\user\AppData\Roaming\npm\pm2 -> C:\Users\user\AppData\Roaming
\npm\node_modules\pm2\bin\pm2
pm2@0.12.7 C:\Users\user\AppData\Roaming\npm\node_modules\pm2
├── json-stringify-safe@5.0.0
├── cli-table@0.3.1
├── eventemitter2@0.4.14
├── commander@2.6.0
├── pidusage@0.1.1
├── cron@1.0.5
├── async@0.9.0
├── isbinaryfile@2.0.3
├── vizion@0.2.3
├── colors@1.0.3
├── shelljs@0.3.0
├── pmx@0.3.5
├── observe-js@0.4.2
├── debug@2.1.0 (ms@0.6.2)
├── pm2-deploy@0.1.2 (tv4@1.0.18)
├── pm2-multimeter@0.1.2 (charm@0.1.2)
├── pm2-axon-rpc@0.3.6 (commander@1.0.5)
├── moment@2.9.0
├── nssocket@0.5.3 (lazy@1.0.11)
├── coffee-script@1.8.0 (mkdirp@0.3.5)
├── chalk@0.5.1 (ansi-styles@1.1.0, escape-string-regexp@1.0.3, supports-color@0
.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── chokidar@0.12.6 (async-each@0.1.6, readdirp@1.3.0)
├── pm2-axon@2.0.8 (amp-message@0.1.2, escape-regexp@0.0.1, amp@0.3.1, configura
ble@0.0.1, debug@2.0.0)
└── pm2-logs@0.1.1 (blessed@0.0.36, chalk@0.4.0, pm2-interface@1.1.0)

D:\_Work>pm2
fs.js:751
  return binding.mkdir(pathModule._makeLong(path),
                 ^
Error: ENOENT, no such file or directory 'D:\Users\user\.pm2'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:751:18)
    at Object.CLI.pm2Init (C:\Users\user\AppData\Roaming\npm\node_modules\p
m2\lib\CLI.js:37:8)
    at Object.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\p
m2\bin\pm2:20:5)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)

我使用的是 Windows 7,我也通过以管理员身份运行进行了尝试。
我想将 js 文件安装为 Windows 服务或其他东西,以便它永远运行。

请帮忙

【问题讨论】:

    标签: javascript node.js command-line-interface pm2


    【解决方案1】:

    看起来这个包在安装过程中试图克隆一个 git repo。不幸的是,至少在 http 上,git repo 似乎很糟糕(http://ikt.pm2.io/ikt.git)。

    这可能是一个暂时的问题,维护者可能错误地配置了 git 或远程服务器。我会在项目 github 上提出一个问题,看看维护者怎么说。

    【讨论】:

      【解决方案2】:

      检查 D:\Users\user\ 中的 .pm2 文件夹,如果此文件夹不存在,请尝试创建并安装后。

      【讨论】:

      • 我需要这样做吗?如果我要在开发机器上这样做,我是否也需要在生产机器上做同样的事情?
      【解决方案3】:

      您可以尝试使用 forever 而不是 pm2

      npm install forever -g
      forever start app.js
      

      foreverjs

      【讨论】:

      • 如果OG需要使用pm2,那如何解决他们的问题?
      猜你喜欢
      • 1970-01-01
      • 2019-04-17
      • 2018-06-21
      • 2015-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-13
      相关资源
      最近更新 更多