npm-adduser无法输入npm帐户的凭据

时间:2016-05-08 14:09:18

标签: node.js npm

我使用不同的机器创建了一个npm包。我git将该包克隆到另一台机器上并尝试运行npm publish并收到以下错误:

npm ERR! need auth auth and email required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "publish"
npm ERR! cwd /home/tarun/me/github/ng-popover
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! code ENEEDAUTH
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/tarun/me/github/ng-popover/npm-debug.log
npm ERR! not ok code 0

我想我需要运行npm-adduser。所以,我运行它并输入我的npm帐户的凭据。然后我收到以下错误:

npm http PUT https://registry.npmjs.org/-/user/org.couchdb.user:tarun-dugar
npm http 400 https://registry.npmjs.org/-/user/org.couchdb.user:tarun-dugar
npm ERR! Error: ValidationError: child "password" fails because ["password" is required] : -/user/org.couchdb.user:tarun-dugar
npm ERR!     at RegClient.<anonymous> (/usr/share/npm/node_modules/npm-registry-client/lib/request.js:272:14)
npm ERR!     at Request.self.callback (/usr/lib/nodejs/request/index.js:148:22)
npm ERR!     at Request.EventEmitter.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/index.js:896:14)
npm ERR!     at Request.EventEmitter.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/usr/lib/nodejs/request/index.js:847:12)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:920:16
npm ERR!     at process._tickCallback (node.js:415:13)
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.13.0-24-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "adduser"
npm ERR! cwd /home/tarun/me/github/ng-popover
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/tarun/me/github/ng-popover/npm-debug.log
npm ERR! not ok code 0

知道如何解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

问题在于我使用的是旧版npm(1.3.10)。为了解决这个问题,我使用此链接中的提示升级了npm:upgrade npm on ubuntu

最后按照此链接中的说明添加符号链接:symlink