npm ERR! code E401 Incorrect or missing password.If you were trying to login, change your password, create an authentication token - npm

Before Trying tis on My new M1 Macbook Air i tried it on Old MacBook and it works seamlessly on older machine like a charm
My
package.json
{
"name": "root",
"private": true,
"devDependencies": {
"lerna": "^3.20.2"
}
}
Steps i followed
1.
npm config set registry "https://npm.pkg.github.com/ABC"
npm login --scope=#ABC --registry=https://npm.pkg.github.com
username: gitusername
Password: PersonalAccessToken
Email: MyEmail#Organization.com
Logged in as gitusername on https://npm.pkg.github.com/.
3.
npm install -g lerna typescript npm-check-updates
Facing this issue as
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at: npm ERR!
https://www.npmjs.com/forgot
npm ERR! npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR! npm login
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/gajanan/.npm/_logs/2021-04-02T05_22_22_130Z-debug.log
PS :ALL THE COMMANDS WORKS ON MY OLD MACBOOK AIR
I struggle with this problem for a very long time, read all the related answers, but there is no clarity.

Related

Unable to run npm install successfully

I'm trying to run npm install (NPM version 8.13.2) but I'm getting this error:
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR! https://www.npmjs.com/forgot
npm ERR!
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR! npm login
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/sipospeter/.npm/_logs/2022-07-07T15_22_06_762Z-debug-0.log
I can't figure out what to do, I've updated and logged in to NPM. I've reset my password too.
What do I have to do to fix it?
Ensure you have RW permission for the folder where npm install is executed, also try npm install -g.

How to use FontAwesome

I've got an .npmrc file set up globally for all of my projects with the following contents:
#fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=********-****-****-****-***********
When I run npm install --save #fortawesome/fontawesome-pro via FontAwesome Docs, I receive the following error message:
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR! https://www.npmjs.com/forgot
npm ERR!
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR! npm login
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ryan_\AppData\Local\npm-cache\_logs\2022-03-03T23_34_32_319Z-debug-0.log
This message gives the impression that I'm logged out of npm or have outdated credentials, but I've updated the password and logged back in to find the same error present.
running npm whoami returns my username as expected.
FontAwesome support has run me through several troubleshooting steps to no avail. Has anyone experienced this issue? Thanks in advance.

NPM Install Incorrect or missing password Error

I am following Strapi's quick start guide to create strapi project. After running this command npx create-strapi-app#latest my-project --quickstart , when trying to run npm install from my-proect directory I am getting the following error:
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR! https://www.npmjs.com/forgot
npm ERR!
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR! npm login
I logged in through npm login command and again run npm install but no luck.
Versions:
user#users-MacBook-Pro my-project % node -v
v14.17.0
user#users-MacBook-Pro my-project % npm -v
8.1.4

Npm install does not installs secure package though i do npm login followed by npm install commands

Even after logged in using npm login command successfully i get the below error
npm whoami
npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://registry.npmjs.org/-/whoami
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/bharathkumar/.npm/_logs/2021-09-09T08_42_29_365Z-debug.log
Try removing contents/remove file .npmrc in the project folder or the user's home folder

Not able to setup a local npm repo

I wrote a library and I want to test that people can import it from npm and use it as expected. Towards this I set up a local NPM repo like
npm install -g local-npm
npm set registry http://127.0.0.1:5080
local-npm
This started a local repository on my computer. Now I went to my library project and I did
npm publish
but I get an error
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
I did
npm adduser
but I get an error
npm adduser
Username: foo
Password:
Email: (this IS public) foo#bar.com
npm ERR! code EAUTHIP
npm ERR! Unable to authenticate, need: Basic
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/.npm/_logs/2018-04-07T17_46_18_631Z-debug.log
For this local repo. I don't want any users etc because this is only for testing. I want to be able to straight publish to this without any credentials or users. is that possible?
Also, another question is that now that I have setup a local npm and I do a npm i react -D in my project the installation would fail because this repository doesn't contain react. So is it possible that when someone does npm i react -D it still goes to the original NPM repository when when I do npm i foo-lib -D only then it comes to my repository as a fallback because the original npm repository doesn't contain my foo-lib it was only published to this local repository.
Edit: I tried npm publish --registry http://127.0.0.1:5800 and I got the following error
0/bin/npm" "publish" "--registry" "http://127.0.0.1:5080"
23 verbose node v9.5.0
24 verbose npm v5.7.1
25 error code ENEEDAUTH
26 error need auth auth required for publishing
27 error need auth You need to authorize this machine using `npm adduser`
28 verbose exit [ 1, true ]
So it won't let me create a user and it won't let me publish without a user.
Edit2:: I tried the other way round as well.
First run local-npm now when the server starts up
from another window do
npm set registry http://127.0.0.1:5080
npm publish --registry http://127.0.0.1:5080
npm publish
everything results in
~/IdeaProjects/t > npm publish --registry http://127.0.0.1:5080
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! A complete log of this run can be found in:
npm ERR! /Users//.npm/_logs/2018-04-07T18_32_53_815Z-debug.log
~/IdeaProjects/t > npm adduser
Username: foo
Password:
Email: (this IS public) foo#bar.com
npm ERR! code EAUTHIP
npm ERR! Unable to authenticate, need: Basic
npm ERR! A complete log of this run can be found in:
npm ERR! /Users//.npm/_logs/2018-04-07T18_33_25_737Z-debug.log
file contents
19 verbose argv "/Users/a/.nvm/versions/node/v9.5.0/bin/node" "/Users/a/.nvm/versions/node/v9.5.0/bin/npm" "adduser"
20 verbose node v9.5.0
21 verbose npm v5.7.1
22 error code EAUTHIP
23 error Unable to authenticate, need: Basic
Try this:
npm publish --registry http://127.0.0.1:5080
https://docs.npmjs.com/misc/registry#can-i-run-my-own-private-registry