NPM Install Incorrect or missing password Error - npm-install

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

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 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

How to update npm in Laravel Sail

I am currently using Laravel 8.48.2 with the Sail package. I set Sail up and running its image through Docker Desktop while using WSL 2 with a Ubuntu distro on Windows. All seems to be working fine.
After I ran sail npm install, the packages were installed successfully, but I received the following message:
npm notice New minor version of npm available! 7.18.1 -> 7.19.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.19.0
npm notice Run npm install -g npm#7.19.0 to update!
Therefore, I tried running sail npm install -g npm#7.19.0 which gave me the following message:
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/lib/node_modules/npm
npm ERR! dest /usr/lib/node_modules/.npm-qUIFSsiV
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/lib/node_modules/npm' -> '/usr/lib/node_modules/.npm-qUIFSsiV'
npm ERR! [Error: EACCES: permission denied, rename '/usr/lib/node_modules/npm' -> '/usr/lib/node_modules/.npm-qUIFSsiV'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/lib/node_modules/npm',
npm ERR! dest: '/usr/lib/node_modules/.npm-qUIFSsiV'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/sail/.npm/_logs/2021-06-26T15_27_02_291Z-debug.log
How can I update the NPM version on Sail?
Thank you in advance.
Current working method:
sail root-shell
npm install -g npm#latest
Looking at your log it seems the user you run as has insufficient permission on the folder /usr/lib/node_modules/. So what you might try is to log in to the container with docker-compose exec laravel.test bash and use chown -R user:group /usr/lib/node_modules/ with the current user and group (found by whoami). Or chmod the folder to have more looser permission overall on this folder.
Thanks to #online Thomas (https://stackoverflow.com/a/68173952/14508436), in order to resolve my issue, I followed these steps:
Within my Laravel project's directory, I ran this command... docker-compose exec laravel.test bash, which points you to the docker's server (or something like that), directly on your project's directory.
I ran this command... npm install -g npm#7.19.0 which updated npm to a newer version without any issues.
I tried the chown and chmod commands as suggested by #online Thomas, but in vain. I still couldn't use the sail npm install -g npm#7.19.0 command outside of the docker's server.

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

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.