12

1.I downloaded node ( latest v4.6.0)

  1. Set proxy path FOR npm
  2. tried npm install
  3. I got the error --- UNABLE_TO_GET_ISSUER_CERT_LOCALLYenter image description here
jayanthCoder
  • 615
  • 1
  • 6
  • 13
  • Does this answer your question? [npm ERR! code UNABLE\_TO\_GET\_ISSUER\_CERT\_LOCALLY](https://stackoverflow.com/questions/45884752/npm-err-code-unable-to-get-issuer-cert-locally) – Krishna Kishore Oct 19 '21 at 10:40

3 Answers3

37

I could not get any help from google(people said downgrade to v0.x) but a colleague helped ..

npm set strict-ssl=false  

This helped ...

I am posting this question and answer for helping people who come across the same error

Siddharth
  • 9,349
  • 16
  • 86
  • 148
jayanthCoder
  • 615
  • 1
  • 6
  • 13
4

Please try using this command:

npm config set registry http://registry.npmjs.org/
Antti29
  • 2,953
  • 12
  • 34
  • 36
Jing
  • 41
  • 1
1

To list all the possible solutions that could be affecting this issue:

Don't enforce SSL (this could work on it's own):

npm config set strict-ssl=false

If that doesn't work, perhaps try adding this (change registry to non-HTTPS URL):

npm config set registry http://registry.npmjs.org/

It might be that your company enforces its own certificate authority (usually using ZScaler), in which case there will be some company documentation to get the certificate file (On mac, use KeyChain and export to PEM, on Windows, run certmgr and export to base64 CER), and then set the cafile to that exported file using:

npm config set cafile /path/to/your/cert.pem

It could also be that the install command runs a node lib\install.js type command within, in which case, disable that failure using:

set NODE_TLS_REJECT_UNAUTHORIZED=0

(In Windows, use export instead of set, and there's also the option to specify export NODE_EXTRA_CA_CERTS=[/path/to/your/cert.pem] instead of disabling it)

Try installing in between all of these steps in case you're not sure what is actually going on.

Marthinus Bosman
  • 105
  • 1
  • 1
  • 10
Sab
  • 69
  • 3