The npm ERR! code E401 Nightmare!!!

Micky Macato
2 min readSep 27, 2021

Have you ever find yourself stuck in this error?! Then well my friend you are not alone!

As I was setting up the environment to build our company’s chatOps, I stumbled upon this error and it was indeed a nightmare!!!

I was trying to download Babel for Typescript’s compiler and ran

npm install — save-dev @babel/preset-typescript

after that my nightmare started!

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

popped up and I had to go over a series of trial and error of googling, fixing and doing it again and again and again.

After 3 days of trying, I could solve it over some Jack Daniel’s and Godiva chocolate. That’s easy right lol. How I wish it was that simple!

--

--

Micky Macato

I am currently working as a Devops Engineer, former English Teacher for 10 years. Entrepreneur in the Philippines. Loves to connect and meet people!