Skip to main content

The Fix: npm ERR! code SELF_SIGNED_CERT_IN_CHAIN [SOLVED]

npm ERR! code SELF_SIGNED_CERT_IN_CHAIN

npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN

npm ERR! request to https://registry.npmjs.org/gulp-cli failed, reason: self signed certificate in certificate chain

What does it even mean? How does one fix this? There are so much information, it's hard to parse what I'm supposed to do.

The Solution: Disable the Company VPN

This is not ideal and you should work in cooperation with your IT security operations to let them know what you are doing and why you need it.

It was reading this article: https://stackoverflow.com/questions/54611707/request-to-https-registry-npmjs-org-co-failed and the comments that finally clued me into our VPN causing the conflict. I previously did not have any issues but our company hired a new CISO who has been very active in hardening our corporate environment.

What didn't work:

  • gulp untrust-dev-cert
  • Removing package-lock.json file
  • Reinstall Node.js

What I wasn't going to try (and you shouldn't either):

  • npm config set strict-ssl false
SSL establishes a trust between you and the source. If you want to turn off that trust, you risk compromising your system to malware and attack by an impersonator taking advantage of that lack of trust. Don't do it.

Comments