Hi @km.jithesh and welcome! I put your question in Ask Sona, our Sonatype-trained AI support at support.sonatype.com, and got this answer. This is a new feature on our Support site and is always available if you have questions (it’s trained on all public-facing customer resources and is always learning, so definitely test before deploying anything!)
The error message you’re seeing, Unable to authenticate, need: BASIC realm=“Sonatype Nexus Repository Manager”, suggests that there might be an issue with the npm client version you’re using.
According to a Sonatype support article, npm client versions 5.0.0 to 5.0.3 have a regression where the old basic authentication method is not supported, which could lead to 401 Unauthorized responses when trying to access a Nexus Repository npm repositories.
If you’re using one of these npm client versions, you could try the following solutions:
-
Upgrade to npm version 5.0.4 or greater
-
Downgrade to an npm version earlier than 5.0.0
-
Run
npm loginand use npm bearer token realm in Nexus Repository 3 -
Possibly try a client-based manual workaround specifying registry specific auth
If none of these solutions work, or if you’re not using one of the affected npm client versions, it might be worth checking if there have been any changes in the authentication requirements or methods in the newer version of Nexus that you’ve upgraded to. You can refer to the Sonatype Help site or the Compatibility Matrix for the most recent state of upgrade compatibility between different Nexus versions.
I hope this helps give you a place to start!