概述
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. (/usr/lib/nodejs/request/main.js:212:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest. (/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!
npm ERR! or use
npm ERR! reportbug --attach /usr/local/grunt/npm-debug.log npm
Thanks everyone for help
謝謝大家的幫助
1 个解决方案
#1
5
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:
我不建議您使用sudo為您的npm安裝(任何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
有關更多信息,請閱讀如何從npm安裝節點。
最后
以上就是聪明乌冬面为你收集整理的linux grunt 离线安装失败,npm安裝-g grunt-cli在Linux中失敗。的全部内容,希望文章能够帮你解决linux grunt 离线安装失败,npm安裝-g grunt-cli在Linux中失敗。所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复