NPM self_signed_cert_in_chain
Solution 1
If you're behind the corporate proxy (which uses e.g. Blue Coat), you should use http instead of https for repository addresses, e.g.
npm config set registry="http://registry.npmjs.org/"
See: Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN while using npm.
You can also import failing self-certificate into your system and mark as trusted, or temporary disable SSL validation while installing packages (quick, but not recommended method):
npm config set strict-ssl false
See: Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN while using npm.
The recommended way (and more painful) is just to point to the right certificate file, e.g.
npm config set cafile "<path to your certificate file>"
See: How to fix SSL certificate error when running Npm on Windows?.
Solution 2
This works for me:
$ export NODE_TLS_REJECT_UNAUTHORIZED=0
$ npm install
Solution 3
Use this command below and it could work fine:
npm config set registry="http://registry.npmjs.org/"
jacobjp52285
Updated on January 14, 2022Comments
-
jacobjp52285 over 2 years
I am having issues getting NPM to install properly. I have tried stepping through the instructions on several of the posts here on stack overflow, specifically from this thread: SELF_SIGNED_CERT_IN_CHAIN error while using npm install
Also I have tried going through the documentation on NPM's site: http://blog.npmjs.org/post/78165272245/more-help-with-selfsignedcertinchain-and-npm
I am still receiving the error everytime I try to install. please advise.