getting code E401 error after running 'npm install'
15:46 16 Feb 2023

I'm trying to clone a ReactJs project by git clone, and after open the project in VS CODE and run 'num install' I'm facing with code E401 error with the following sentence:

npm ERR! code E401
npm ERR! Unable to authenticate, your authentication token seems to be invalid.
npm ERR! To correct this please trying logging in again with:
npm ERR!     npm login

after I try to login I'm getting this error:

npm ERR! code E400
npm ERR! 400 Bad Request - PUT https://...

I saw that my account in vs code in not connected, so I logged in and still same error. After a few hours of searching for a solution I realized that it was related to the .npmrc file, because other projects that doesn't have the npmrc file works fine, but I can't understand what is the problem exactly.

My .npmrc file is look like:

registry=https://...
                        
always-auth=true

I'm tried to remove it, and delete package-lock.json and still not working.

node.js reactjs macos visual-studio-code npm