Scoped Package 404 (Missing Registry Mapping) in CI - Fix Scope Resolution
A 404 for a scoped package usually means npm queried the wrong registry. Without a scope-to-registry mapping, npm asks the public registry for a private scope and gets nothing.
What this error means
npm install returns 404 Not Found for an @scope/package even though it exists in your private registry, because .npmrc has no mapping telling npm where that scope lives.
npm
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@acme%2fcore
npm ERR! 404 '@acme/core@^1.0.0' is not in the npm registry.Common causes
No scope-to-registry mapping in .npmrc
The scope is not mapped to its private registry, so npm defaults to the public one, which does not host it.
The mapping exists locally but not in CI
A developer .npmrc has the mapping while the CI checkout does not, so installs fail only in CI.
How to fix it
Map the scope and authenticate
- Add the scope-to-registry line and an auth token to .npmrc.
- Reinstall so npm queries the private registry.
.npmrc
@acme:registry=https://registry.acme.internal/
//registry.acme.internal/:_authToken=${NPM_TOKEN}How to prevent it
- Commit a shared .npmrc (token via env) that maps every private scope to its registry, so local and CI resolve scoped packages identically.
Related guides
npm Scoped Registry 404 - Fix Missing @scope:registry Mapping in CIFix a scoped-package 404 in CI - when @scope:registry is unmapped (or mapped to the wrong host) so npm querie…
npm E404 Not Found in CI - Fix Missing Package ErrorsFix npm E404 "Not Found" errors in CI when a package or version does not exist at the configured registry, by…
npm .npmrc Auth Token in CI - Configure Registry Credentials SafelyConfigure the npm .npmrc auth token in CI so private installs authenticate, injecting the token from a secret…