npm adduser报错Unable to authenticate?

clipboard.png
registry是https://registry.npmjs.org/,npm和node都升级最新版本了,还是没有用,请问是什么原因啊?

------更新日志文件

0 info it worked if it ends with ok
1 verbose cli [ 'D:\\office\\node.exe',
1 verbose cli   'C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'adduser' ]
2 info using npm@5.6.0
3 info using node@v8.9.4
4 verbose npm-session 188287595600020d
5 verbose login before first PUT { _id: 'org.couchdb.user:flash',
5 verbose login   name: 'flash',
5 verbose login   password: 'XXXXX',
5 verbose login   type: 'user',
5 verbose login   roles: [],
5 verbose login   date: '2018-02-28T02:32:52.205Z' }
6 http request → PUT https://registry.npmjs.org/-/user/org.couchdb.user:flash
7 http 401 ← Unauthorized (https://registry.npmjs.org/-/user/org.couchdb.user:flash)
8 verbose adduser before first PUT { _id: 'org.couchdb.user:flash',
8 verbose adduser   name: 'flash',
8 verbose adduser   password: 'XXXXX',
8 verbose adduser   email: '469509244@qq.com',
8 verbose adduser   type: 'user',
8 verbose adduser   roles: [],
8 verbose adduser   date: '2018-02-28T02:32:54.215Z' }
9 http request → PUT https://registry.npmjs.org/-/user/org.couchdb.user:flash
10 http 401 ← Unauthorized (https://registry.npmjs.org/-/user/org.couchdb.user:flash)
11 verbose stack Error: Unable to authenticate, need: Basic
12 verbose statusCode 401
13 verbose cwd C:\Users\Administrator\Desktop\work\menu-vue
14 verbose Windows_NT 10.0.14393
15 verbose argv "D:\\office\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "adduser"
16 verbose node v8.9.4
17 verbose npm  v5.6.0
18 error code EAUTHIP
19 error Unable to authenticate, need: Basic
20 verbose exit [ 1, true ]
阅读 10.5k
4 个回答

很简单的问题,npm这个报错我也是服了,就是flash这个用户名被注册过了,换一个就好了,我解决了在这里记录一下,怕以后忘了...

我的这个Unable to authenticate, need: Basic 是因为username 需要 ~开头,登录的时候漏了,所以报这个错误,估计你这个问题也差不多少了个~

新手上路,请多包涵
info using npm@6.4.1
info using node@v8.16.0

npm@6.4.1 也报这个错,更新到 npm@6.9.0 可以正常登陆。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
1 篇内容引用
推荐问题
宣传栏