How to fix NPM error “Unable to authenticate, need: Bearer Authentication_URI” in NodeJS
As you work with the NodeJS application development, you are going to encounter the unexpected errors that will make you puzzled along the way. One of the common errors that you will encounter is a message like the following:
“Unable to authenticate, need: Bearer authentication_uri” etc etc
This error usually occurs as you try to install packages through “npm install” command, and this indicates that you need to correctly configure the remote NPM registry. If the application project is a simple, public project, the default NPM registry usually points to https://registry.npmjs.org, as you can find from here. However, when you start start working at a company, the chance is that the NPM repos are likely hosted in private registries, using the technologies like Nexus, Artifactory, Azure Registry, etc.
To fix this, you need to properly configure your .npmrc file. The case depends on whether this is a new project or an existing project.
CASE #1: If this is a new project, you likely need to locate the internal documentation or to talk to somebody who can point you to the right direction that points you where the company’s NPM registry is, authentication mechanism, etc.