npm install gives unauthorized name or password is incorrect error

前端 未结 10 692
北荒
北荒 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:16

    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.

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

    i tried

    npm cache clean
    

    but it didn't work. I didn't see .npmrc in my directory. I killed my bash shell (terminal on mac) and brought up a new one and that seemed to do the trick. Not sure if it was the bash refresh or the npm cache clean or a combination of the two.

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

    npm cache verify is what you need

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

    Removing package-lock.json and node_modules did the trick in my case.

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