简体   繁体   English

npm install -g grunt-cli在Linux中失败了

[英]npm install -g grunt-cli failed in Linux

I try to run next command in Linux : 我尝试在Linux中运行下一个命令:

npm install -g grunt-cli

The message I get is next: 我得到的信息是下一个:

npm http GET https://registry.npmjs.org/grunt-cli

npm ERR! Error: failed to fetch from registry: grunt-cli
npm ERR!     at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.onIncoming (http.js:1261:11)
npm ERR!     at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /usr/local/grunt/npm-debug.log npm

Thanks everyone for help 谢谢大家的帮助

I don't recommend to use sudo for your npm installations (any sudo npm install), it seems like you need to update your repository, I'm not sure whet distro you are using but if debian or ubuntu you should do something like: 我建议不要在你的npm安装中使用sudo(任何sudo npm安装),看起来你需要更新你的存储库,我不确定你使用的是发行版,但是如果debian或ubuntu你应该做类似的事情:

sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

for more info read how to install node from npm 有关更多信息,请阅读如何从npm安装节点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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