gpt4 book ai didi

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

转载 作者:搜寻专家 更新时间:2023-10-31 23:38:31 27 4
gpt4 key购买 nike

我尝试在 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

有关更多信息,请阅读 how to install node from npm

关于linux - npm install -g grunt-cli 在 Linux 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26630831/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com