【问题标题】:npm install get errno -2 with weird lognpm install get errno -2 奇怪的日志
【发布时间】:2016-05-06 12:45:38
【问题描述】:

使用“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

【问题讨论】:

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


    【解决方案1】:

    顺序颠倒,试试:npm install pm2@1.0.1 -g

    【讨论】:

    • 我认为这并不重要,我通常在“npm install”后面使用 -g 或 --save 安装 :(
    猜你喜欢
    • 2014-10-17
    • 1970-01-01
    • 1970-01-01
    • 2016-01-21
    • 1970-01-01
    • 2018-06-18
    • 2012-11-21
    • 2015-05-21
    • 2017-03-16
    相关资源
    最近更新 更多