npm install使用奇怪的日志获取errno -2

时间:2016-05-06 03:16:56

标签: node.js npm npm-install pm2 enoent

使用“npm install -g”命令安装pm2时出现此错误。 我不知道为什么“-g”选项被附加到当前工作目录然后它返回ENOENT(没有这样的文件或目录) 任何人遇到这个问题,请帮助解决这个问题。 提前谢谢了。 以下是安装时的日志:

[root@XXXXX folder]# npm install –g pm2@1.0.1
npm ERR! addLocal Could not install /path/to/project/folder/–g
npm ERR! fetch failed https://registry.npmjs.org/pm2/-/pm2-1.0.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 400
npm ERR! fetch failed https://registry.npmjs.org/pm2/-/pm2-1.0.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 400
npm ERR! fetch failed https://registry.npmjs.org/pm2/-/pm2-1.0.1.tgz
npm ERR! Linux 2.6.32-431.el6.x86_64
npm ERR! argv "/opt/dtv/node-v4.2.6-linux-x64/bin/node" "/opt/dtv/node-v4.2.6-linux-x64/bin/npm" "install" "–g" "pm2@1.0.1"
npm ERR! node v4.2.6
npm ERR! npm v2.14.12
npm ERR! path /path/to/project/folder/–g
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/path/to/project/folder/–g'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

1 个答案:

答案 0 :(得分:0)

订单相反,请尝试:npm install pm2@1.0.1 -g