簡體   English   中英

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

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

我嘗試在Linux中運行下一個命令:

npm install -g grunt-cli

我得到的信息是下一個:

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

謝謝大家的幫助

我建議不要在你的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

有關更多信息,請閱讀如何從npm安裝節點

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM