Skip to content
MtrXTools

npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY

npm can't verify the registry's certificate

Seen in npm, npx, yarn and pnpm behind corporate proxies

Node.js could not find the CA that issued the registry's certificate, so npm refused the HTTPS connection.

Common causes

  • A corporate proxy or antivirus intercepts HTTPS and signs with its own CA, which Node.js does not trust.
  • A private registry (Nexus, Artifactory, Verdaccio) is missing its intermediate certificate.
  • An old Node.js version ships an outdated CA list.

How to fix it

  1. Give npm your corporate CA: npm config set cafile /path/to/corp-ca.pem.
  2. Or for all Node.js tools: export NODE_EXTRA_CA_CERTS=/path/to/corp-ca.pem.
  3. For a private registry, install the full chain on the server.
  4. strict-ssl=false only hides the problem; it is not a fix.
See the certificate the registry really sends

Got a different message? Paste it into the error explainer.

Related errors

All 31 Dev tools & SSH errors