npm install gives unauthorized name or password is incorrect error

前端 未结 10 691
北荒
北荒 2021-02-01 14:35

When I try to install tap using

npm install tap

I get the following error:

npm ERR! Error: unauthorized Name or password is inc         


        
相关标签:
10条回答
  • 2021-02-01 15:04

    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

    0 讨论(0)
  • 2021-02-01 15:06
     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.
    
    0 讨论(0)
  • 2021-02-01 15:06

    Also you can use

    npm cache clean
    
    0 讨论(0)
  • 2021-02-01 15:09

    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.

    0 讨论(0)
  • 2021-02-01 15:10

    I had a an odd issue where I got the credentials error and it was because npm login had cached bad credentials and then npm logout didn't clear the credentials (as evidenced by "npm login" always showing my default details).

    NPM stores your login under the globals NPM_CONFIG_EMAIL and NPM_CONFIG__AUTH. If you do "npm config ls -la" and see email under "environment configs" you may have the same issue I had (where npm logout didn't work).

    Unset the globals NPM_CONFIG__AUTH and NPM_CONFIG_EMAIL and then npm login again and it should work. (in terminal it's just "unset NPM_CONFIG__AUTH")

    0 讨论(0)
  • 2021-02-01 15:11

    If you have changed your system LAN password, run npm login and provide your new password.

    Once the login is successful, you will not get error while doing npm install.

    0 讨论(0)
提交回复
热议问题