nodejs “npm ERR! code SELF_SIGNED_CERT_IN_CHAIN”

Disabling strict-ssl mode will remove this error.

npm set strict-ssl false

Since this is turning off SSL security, we should try this as last step if below two steps don’t help.

This issue can arise due to incompatibility between SSL certificate file of npm and node registry.

Try

1) telling your current version of npm to use node’s ca instead of built in ca

npm config set ca=""

2) OR upgrading your version of npm

npm install npm -g --ca=null

Leave a Comment