{"id":123,"hash":"4c7c3cb61ad24682c74ac2c1dc3500f11837ad3e7704a9da89942f8c15c4f67a","pattern":"npm error E401: Unable to authenticate, need: BASIC realm=&quot;Sonatype Nexus Repository Manager&quot;","full_message":"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\n\n code E401\n npm ERR! Unable to authenticate, need: BASIC realm=\"Sonatype Nexus Repository Manager\"\n\nI even tried deleting node_modules and package-lock.json and running npm install again, but doesn't change anything.","ecosystem":"npm","package_name":"node.js","package_version":null,"solution":"I had similar issue. I resolved it by adding _auth into my ~/.npmrc. See the doc how to encode your nexus credential. I added the encoded credential using npm config set _auth xxx.\n\nYou wont be able to see the value using npm config list or npm config get _auth.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/61613797/npm-error-e401-unable-to-authenticate-need-basic-realm-sonatype-nexus-reposi","votes":99,"created_at":"2026-04-19T04:41:21.902057+00:00","updated_at":"2026-04-19T04:51:03.651329+00:00"}