npm error E401: Unable to authenticate, need: BASIC realm=”Sonatype Nexus Repository Manager”

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.

You wont be able to see the value using npm config list or npm config get _auth.

Leave a Comment