简体   繁体   中英

error while installing pm2 - node js

i am trying to install pm2 ( https://github.com/Unitech/pm2 )

i get this error :

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)

I am having Windows 7 and i tried this by Run as Administrator as well.
I want to install a js file as a windows service or something else so that it runs forever.

Kindly assist

It looks like the package is trying to clone a git repo during the install process. Unfortunately the git repo appears to be borked ( http://ikt.pm2.io/ikt.git ), on http at least.

This could be a transient problem, the maintainer might have misconfigured git or the remote server. I'd raise an issue on the projects github and see what the maintainer says.

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

You could try using forever instead of pm2

npm install forever -g
forever start app.js

foreverjs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM