UNABLE_TO_GET_ISSUER_CERT_LOCALLY 📦 npm

npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY

npm can’t verify the registry’s certificate chain — missing intermediate or intercepted connection.

Seen on: npm

Meaning

Same family as the self-signed chain error: corporate proxies, outdated Node CA bundles, or private registries with incomplete chains.

Common causes

  • Corporate proxy CA not trusted
  • Very old Node/npm
  • Private registry missing intermediates

⚡ Quick fix

  1. Configure cafile with the company/registry CA
  2. Update Node/npm
  3. Fix the registry’s certificate chain

Detailed fix by platform

npm

  1. npm config set cafile ./certs/registry-chain.pem

How to diagnose

  1. Chain — openssl s_client against the registry
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.