npm install gives unauthorized name or password is incorrect error

前端 未结 10 690
北荒
北荒 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: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")

提交回复
热议问题