npm adduser Error:Incorrect username or password!【Mac OS系统下】
刚开始根据提示我去修改了下密码,结果修改了之后 仍然不能登录,然后就开始google了一下,发现github上的npm issue关于这个的问题一大把,最终找到了一个有效的解决方法。
npm adduser: pulling credentials from config in wrong order
报错内容
npm WARN adduser Incorrect username or password
npm WARN adduser You can reset your account by visiting:
npm WARN adduser
npm WARN adduser https://npmjs.org/forgot
npm WARN adduser
npm ERR! Linux 3.13.0-35-generic
npm ERR! argv "node" "/usr/local/bin/npm" "adduser"
npm ERR! node v0.10.25
npm ERR! npm v2.0.0
npm ERR! code E401
npm ERR! unauthorized Name or password is incorrect.: -/user/org.couchdb.user:jabbath/-rev/10-8eff33d84e95a8cba455d06adfeb1eab
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/anton/Documents/xbox/npm-debug.log
解决方法
xiaodong:~ lixd$ npm config ls -l|grep config
; cli configs
; globalconfig /usr/local/etc/npmrc
globalconfig = "/usr/local/etc/npmrc"
userconfig = "/Users/lixd/.npmrc" [这个文件本地如果没有的话,会使用globalconfig里的npmrc]
如果userconfig下的.npmrc存在,则删除即可; 否则删除globalconfig下的npmrc文件。 删除了之后,即可npm login & npm publish
找到.npmrc文件 我的电脑上文件地址是在 /Users/xiaodong/.npmrc