Fix npm SELF_SIGNED_CERT_IN_CHAIN or CERT_UNTRUSTED errors
UPDATE
The npm maintainers have rolled back the changes to the npm self-signed certificate. See More help with SELFSIGNEDCERTINCHAIN and npm. I'm leaving this ProTip available in the event npm publishes this certificate change again.
Background
The npm maintainers announced on February 27th that npm’s Self-Signed Certificate is No More:
A bunch of users received a “SELFSIGNEDCERTINCHAIN” error during installing and publishing packages throughout the day today.
The cause: npm no longer supports its self-signed certificates.
However, the recommended fix failed for me.
Workaround
A workaround for the fix is to use the npm environmental variable for the strict-ssl setting:
Linux / OS X:
export npm_config_strict-ssl=false
npm install npm -g --ca=null
npm --version
unset npm_config_strict-ssl
Windows:
SETLOCAL
SET npm_config_strict-ssl=false
npm install npm -g --ca=null
npm --version
ENDLOCAL
Written by Steve Jansen
Related protips
1 Response
The command you given ,none of them working.
{ [Error: s
IN_CHAIN' }
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Npm
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#