npm adduser错误,出现400错误

时间:2015-04-11 00:06:53

标签: node.js npm

我正在尝试npm adduser,我输入了它要求的所有信息,当我这样做时,我收到以下错误:

npm http PUT https://registry.npmjs.org/-/user/org.couchdb.user:thecolorred
npm http 400 https://registry.npmjs.org/-/user/org.couchdb.user:thecolorred
npm ERR! Error: Unknown error while authenticating : -/user/org.couchdb.user:thecolorred
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-34-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "adduser"
npm ERR! cwd /etc/node-http-server/modules/tpl
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!     /etc/node-http-server/modules/tpl/npm-debug.log
npm ERR! not ok code 0

错误告诉我检查日志文件,所以我检查日志文件并获得此输出:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'adduser' ]
2 info using npm@1.3.10
3 info using node@v0.10.25
4 verbose adduser before first PUT { name: 'thecolorred',
4 verbose adduser   salt: 'XXXXX',
4 verbose adduser   password_sha: 'XXXXX',
4 verbose adduser   email: 'xxxxxxx@gmail.com',
4 verbose adduser   _id: 'org.couchdb.user:thecolorred',
4 verbose adduser   type: 'user',
4 verbose adduser   roles: [],
4 verbose adduser   date: '2015-04-10T23:49:58.581Z' }
5 verbose url raw /-/user/org.couchdb.user:thecolorred
6 verbose url resolving [ 'https://registry.npmjs.org/',
6 verbose url resolving   './-/user/org.couchdb.user:thecolorred' ]
7 verbose url resolved https://registry.npmjs.org/-/user/org.couchdb.user:thecolorred
8 info trying registry request attempt 1 at 19:49:58
9 http PUT https://registry.npmjs.org/-/user/org.couchdb.user:thecolorred
10 http 400 https://registry.npmjs.org/-/user/org.couchdb.user:thecolorred
11 verbose adduser back [ [Error: Unknown error while authenticating : -/user/org.couchdb.user:thecolorred],
11 verbose adduser   { ok: false, error: 'Unknown error while authenticating' },
11 verbose adduser   '{"ok":false,"error":"Unknown error while authenticating"}' ]
12 error Error: Unknown error while authenticating : -/user/org.couchdb.user:thecolorred
12 error     at RegClient.<anonymous> (/usr/share/npm/node_modules/npm-registry-client/lib/request.js:272:14)
12 error     at Request.self.callback (/usr/lib/nodejs/request/index.js:148:22)
12 error     at Request.EventEmitter.emit (events.js:98:17)
12 error     at Request.<anonymous> (/usr/lib/nodejs/request/index.js:896:14)
12 error     at Request.EventEmitter.emit (events.js:117:20)
12 error     at IncomingMessage.<anonymous> (/usr/lib/nodejs/request/index.js:847:12)
12 error     at IncomingMessage.EventEmitter.emit (events.js:117:20)
12 error     at _stream_readable.js:920:16
12 error     at process._tickCallback (node.js:415:13)
13 error If you need help, you may report this log at:
13 error     <http://github.com/isaacs/npm/issues>
13 error or email it to:
13 error     <npm-@googlegroups.com>
14 error System Linux 3.13.0-34-generic
15 error command "/usr/bin/nodejs" "/usr/bin/npm" "adduser"
16 error cwd /etc/node-http-server/modules/tpl
17 error node -v v0.10.25
18 error npm -v 1.3.10
19 verbose exit [ 1, true ]

我不知道它告诉我的是什么,adduser为什么不起作用?

1 个答案:

答案 0 :(得分:2)

你的npm版本(1.3.10)过于陈旧,从那时起已经进行了一些非向后兼容的更改。

当前稳定版本为2.7.6