问题
I upgraded node version to 12.16.2 and npm version to 6.14.4. After that I am not able to run npm install
, as I'm getting this error
code E401
npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
I even tried deleting node_modules and package-lock.json and running npm install again, but doesn't change anything.
回答1:
I found a way out. With this new npm version they are enforcing authentication to access certain packages. We realised we don't need to use authentication for any of the packages we were downloading, hence the auth code we had was unnecessary. So we just removed it and it all worked.
来源:https://stackoverflow.com/questions/61613797/npm-error-e401-unable-to-authenticate-need-basic-realm-sonatype-nexus-reposi