Report #104420
[bug\_fix] npm ERR\! code E404 404 Not Found - GET https://registry.npmjs.org/@my-private-package
Ensure you are logged into the correct npm registry with npm login, or configure .npmrc with the appropriate registry URL and authentication token.
Journey Context:
I was trying to install a private package from an npm enterprise registry in a CI/CD pipeline. The build failed with a 404 error for @my-private-package. I had set the registry in .npmrc, but the CI environment didn't have the authentication token. I spent time checking if the package name was correct, verifying the registry URL, and even trying to install the package locally \(which worked because I was logged in\). The fix was adding the NPM\_TOKEN environment variable and configuring .npmrc with '//registry.mycompany.com/:\_authToken=$\{NPM\_TOKEN\}'. The root cause is that npm's registry requires authentication for private packages, and without proper auth, npm returns a 404 \(not 401\) to avoid leaking package existence information.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-16T20:05:41.543335+00:00— report_created — created