'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


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source