Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when `npm login` with correct account and password , why still get 'Incorrect username or password'?

Tags:

npm

I cannot use my pair of username and password to run npm login success in terminal, while

I use a pair of account and password to login npmjs.com website. But when execute npm login in terminal, this error appeared:

npm WARN adduser Incorrect username or password
npm WARN adduser You can reset your account by visiting:
npm WARN adduser
like image 419
John Xiao Avatar asked Oct 19 '15 06:10

John Xiao


1 Answers

View npm config through npm config ls, check the registry

→ npm config ls
; cli configs
user-agent = "npm/2.14.2 node/v4.0.0 darwin x64"

; userconfig /Users/xxx/.npmrc
email = "[email protected]"
registry = "https://registry.npm.taobao.org/"

If you use third party registry like 'taobao.org' etc., you will absolutely get the 'Incorrect username or password' error tip.

Solution

Change back to use official registry npmjs.org temporarily:

npm config set registry https://registry.npmjs.org/

like image 54
John Xiao Avatar answered Oct 02 '22 20:10

John Xiao



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!