2

I have a private GitHub package dependency that's registered through npm. https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry

Installing and building locally works but Heroku throws 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've added an .npmrc with auth token as a Config Var but still no luck. Any suggestions?!

linabell
  • 21
  • 1

2 Answers2

1

i ran into the same issue just now, wasn't able to reproduce it locally but downgrading npm from v7 to v6 worked for me.

0

I had the same issue. I solved this by limiting both the node and npm version in the package.json to what I run locally:

"engines": { "node": "14.x", "npm": "6.x" },