Npm ERR! code E401 NPM missing password tryin to deploy Strapi

I’m attempting to deploy Strapi and I’m getting a 401 error that appeared to be related to an issue caused by my .npmrc file. I had an old auth token for Font Awesome in the file, and I believe I’m having the issue described here:

https://forum.strapi.io/t/cannot-deploy-new-v4-strapi-project-to-heroku-or-render-getting-401-unauthorized-error-on-fontawesome-request/16731

I removed my .npmrc file, deleted package.json, and re-installed dependencies. However, I still get the same error.

npm ERR! code E401
Sep 30 01:51:48 PM  npm ERR! Incorrect or missing password.
Sep 30 01:51:48 PM  npm ERR! If you were trying to login, change your password, create an
Sep 30 01:51:48 PM  npm ERR! authentication token or enable two-factor authentication then
Sep 30 01:51:48 PM  npm ERR! that means you likely typed your password in incorrectly.
Sep 30 01:51:48 PM  npm ERR! Please try again, or recover your password at:
Sep 30 01:51:48 PM  npm ERR!     https://www.npmjs.com/forgot
Sep 30 01:51:48 PM  npm ERR!
Sep 30 01:51:48 PM  npm ERR! If you were doing some other operation then your saved credentials are
Sep 30 01:51:48 PM  npm ERR! probably out of date. To correct this please try logging in again with:
Sep 30 01:51:48 PM  npm ERR!     npm login
Sep 30 01:51:48 PM  
Sep 30 01:51:48 PM  npm ERR! A complete log of this run can be found in:
Sep 30 01:51:48 PM  npm ERR!     /opt/render/.cache/_logs/2022-09-30T20_51_48_160Z-debug.log
Sep 30 01:51:48 PM  ==> Build failed 😞

How can I further investigate and find the cause of the issue? Or, can anyone provide any ideas or solutions?

Austin

Okay, it only worked for me after adding back my .npmrc, replacing the old contents of that file, then once again clearing package-lock.json and re-installing dependancies. Since this was very unclear, I first tried replacing my .npmrc and just setting it to the standard registry, without any better idea what to do, and that ended up working for me:

npm config set registry "https://registry.npmjs.com/"

Not sure what else would also work here, but in any case this finally solved it for me.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.