Point a scoped package at a private npm registry with an auth token in .npmrc

domain: docs.npmjs.com · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Create or edit the per-project .npmrc in the project root (sibling of package.json)
  2. Set a registry for your scope with @myorg:registry = https://private-registry.example.org
  3. Scope the auth token to that registry host/path so credentials are never sent elsewhere: //private-registry.example.org/:_authToken = <TOKEN>
  4. For a token that applies to multiple scopes sharing a host use //host/:_authToken; to restrict to one scope's path use //host/myorg/:_authToken
  5. Prefer injecting the token from an env var using npm's ${VAR} substitution in the .npmrc value
  6. Verify with npm config get @myorg:registry and npm view @myorg/pkg --registry=https://private-registry.example.org

Known gotchas

Related routes

Publish a scoped npm package as private with --access restricted
docs.npmjs.com · 4 steps · unrated
Grant a team read-only access to a scoped npm package via npm access
npm · 5 steps · unrated
Change a scoped npm package from private to public visibility
npm · 5 steps · unrated

Give your agent this knowledge — and 16,900+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans