I am working with a Macos sonoma 14.5, node version is 22.2.0, npm 10.8.1.
The command “npm install” and “npm update” is always returning the following error :
npm error code E401
npm error Incorrect or missing password.
npm error If you were trying to login, change your password, create an
npm error authentication token or enable two-factor authentication then
npm error that means you likely typed your password in incorrectly.
npm error Please try again, or recover your password at:
npm error https://www.npmjs.com/forgot
npm error
npm error If you were doing some other operation then your saved credentials are
npm error probably out of date. To correct this please try logging in again with:
npm error npm login
npm error A complete log of this run can be found in: /Users/basilyklelezard/.npm/_logs/2024-06-06T17_49_30_999Z-debug-0.log
I already tried to :
-
“npm logout” and “npm login” with a successful
-
make a npm token and store it in .npmrc
“nano ~/.npmrc”
“//registry.npmjs.org/:_authToken=your_generated_auth_token”
“npm config list” -
delete node modules and package lock “rm -rf node_modules package-lock.json”
-
clear cache “npm cache clean –force”
I am open to any comments ! thanks