npm install gives unauthorized name or password is incorrect error

I was also having this problem. Mine has arised because I have changed my password in npmjs.org. So, try Login in npm from terminal again with your new password and then install any module. It worked for me.


 1.>Go to your this location

    C:\Users\{your user name or ID}

 2.> open .npmrc & Remove all content from .npmrc file.

 3.>reopen your new command prompt

 4.>again run the code , will work.

You might have _auth entry configured in the .npmrc config file ($HOME/.npmrc). Just delete the entry if you are using the public registry as it's not needed. If you're using a private npm registry you should check with your admin that that's the correct auth key for you to access the registry.

I would not recommend just deleting the whole file (.npmrc) as the file might contain important configurations for your npm to work correctly. i.e.: proxy config.


Found the answer.

Remove .npmrc from my home directory and it works!

Thanks to mcollina https://github.com/mcollina at https://github.com/isaacs/npm/issues/2778