“SELF_SIGNED_CERT_IN_CHAIN” in npm on Mac
SELF_SIGNED_CERT_IN_CHAIN means that the certificate chain holds a certificate that no known authority signed. On a work network, a TLS-inspecting proxy is the usual source.
My Mac has this problem: “SELF_SIGNED_CERT_IN_CHAIN” in npm on Mac. Read https://kilobat.app/guides/npm-self-signed-cert-in-chain.md and work through it with me. Install the Kilobat CLI if it’s missing: brew install seifip/kilobat/kilobat. Run the guide’s Terminal and kilobat checks yourself and tell me what you find. List the steps only I can do. Ask before you change any setting.
Symptoms
npm installstops withnpm error code SELF_SIGNED_CERT_IN_CHAIN.- The message says
self-signed certificate in certificate chain. - It starts on a company network, or after a security app is installed.
Likely causes
- A TLS-inspecting proxy. The proxy replaces the registry certificate with its own. See Corporate proxy certificates break Terminal tools on a Mac.
- A security app that scans HTTPS. It can add its own root to the traffic.
- An old npm. The npm common-errors page says that npm no longer supports its former self-signed certificates.
- A private registry. A registry with a private authority needs that authority’s certificate.
How to check
Read the issuer of the registry certificate.
curl -v -o /dev/null https://registry.npmjs.org/ 2>&1 | grep -i issuerShow the CA file that npm uses.
npm config get cafileCheck the npm version.
npm --versionTry a phone hotspot. If it works, the first network inspects TLS.
How to fix it
Get the root certificate from the network administrator, in PEM format.
Point npm at it.
npm config set cafile /path/to/ca.pemUpdate npm if it is old.
npm install npm -gDo not set
strict-sslto false. The npm documentation advises against it.
With Kilobat
Kilobat's connection doctor tests the registry layer by layer. The TLS layer shows a certificate that this Mac does not trust.
kilobat why https://registry.npmjs.org/These Kilobat checks are free. AI agents run them through MCP with
diagnose_connectionanddiagnose_network. See Find why one site or API won't connect.
Questions
Is npm config set strict-ssl false safe?
It turns off the certificate check. The npm documentation advises against it for proxy errors. Add the proxy’s CA instead.
Why does the error appear only at work?
A proxy that inspects TLS signs traffic with its own certificate. Your Mac does not trust it.
Sources
Checked on 29 October 2026.