微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

node.js – npm安装会导致未经授权的名称或密码错误

当我尝试安装水龙头使用

npm install tap

我得到以下错误

npm ERR! Error: unauthorized Name or password is incorrect.: tap

以下是整个回应:

npm http GET https://registry.npmjs.org/tap
npm http 401 https://registry.npmjs.org/tap
npm ERR! Error: unauthorized Name or password is incorrect.: tap
npm ERR!     at RegClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:253:14)
npm ERR!     at Request.init.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/main.js:120:22)
npm ERR!     at Request.EventEmitter.emit (events.js:91:17)
npm ERR!     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:648:16)
npm ERR!     at Request.EventEmitter.emit (events.js:115:20)
npm ERR!     at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/usr/local/lib/node_modules/npm/node_modules/request/main.js:610:14)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:115:20)
npm ERR!     at IncomingMessage._emitEnd (http.js:366:10)
npm ERR!     at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
npm ERR!     at CleartextStream.socketonData (http.js:1366:20)
npm ERR! If you need help,you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.2.0-31-generic-pae
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "tap"
npm ERR! cwd /home/thaddeus
npm ERR! node -v v0.8.8
npm ERR! npm -v 1.1.59
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/thaddeus/npm-debug.log
npm ERR! not ok code 0

解决方法

找到答案。

从我的主目录中删除.npmrc,它的工作原理!

感谢mcollina https://github.com/mcollina at https://github.com/isaacs/npm/issues/2778

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐