NPM ERR Code E401: Unable to authenticate, need: Bearer authorization

Solution 1:

This is what worked for me.

First, delete the .npmrc file in your Users folder. This folder:

C:\Users\[your user name]

Then run this command in your project folder that has an .npmrc file in it:

npx vsts-npm-auth -config .npmrc

Solution 2:

Use npm install --registry https://registry.npmjs.org instead of npm install