Npm installation error - failed to get local issuer certificate

I get an unable to get local issuer certificateerror unable to get local issuer certificatewhile installing npm:

typings ERR! message Unable to read typings for "es6-shim". You should check the
 entry paths in "es6-shim.d.ts" are up to date
typings ERR! caused by Unable to connect to "https://raw.githubusercontent.com/D
efinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/es6-shim
/es6-shim.d.ts"
typings ERR! caused by unable to get local issuer certificate

I recently upgraded node 4 from an earlier version, and it seems that the node becomes more severe when similar problems occur.

There is a problem discussed here that talks about using CA files, but this is a bit above my understanding, and I'm not sure what to do about it.

I am behind the corporate firewall, but I can easily access the URL in the browser.

Does anyone have a further understanding of this problem and what are the possible solutions?

I am wondering about returning to node 0.12 in the meantime :(

+24
7

~/.typingsrc. (~ )

github: https://github.com/typings/typings/issues/120, , ~/.typingsrc :

{
  "proxy": "http://<server>:<port>",
  "rejectUnauthorized": false
}

proxy, , , - -.

, typings , , . , .

+11

npm config set strict-ssl false. , url https://github.com/nodejs/node/issues/3742

+49

, CA , , , .

, , ! Windows:

Chrome, URL, NPM ( https://raw.githubusercontent.com ). Security-> . , , . "" " ...".

DER PEM. , , , - -, .

, ,

-----BEGIN CERTIFICATE----- 

yourkey

-----END CERTIFICATE-----

, . , , . github npm .

.npmrc , , ,

cafile=C:\workspace\rootCerts.crt

, -, strict-ssl. YMMV.

+12

, .

100%

-npm config set strict-ssl false
+4

: , , . - VPN/firewall. , .typingsrc (C:\Users\MyUserName\.typingsrc Windows). , , SSL, , .

URL- https http, , nfiles , rejectUnauthorized false.

.typingsrc ( )

{
     "rejectUnauthorized": false,
     "registryURL": "http://api.typings.org/"
}

github ( , .)

{
    "rejectUnauthorized": false,
    "registryURL": "http://api.typings.org/",
    "githubToken": "YourGitHubToken"
}

GitHub . https://github.com/blog/1509-personal-api-tokens.

+1

, , . - SSL.

PhantomJS PATH
https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-windows.zip
C:\Users\Sam\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip
...

.
:
TLSSocket. (_Tls_wrap.js: 1105: 38)
emitNone (events.js: 106: 13)
TLSSocket.emit(events.js: 208: 7)
TLSSocket._finishInit (_tls_wrap.js: 639: 8)
TLSWrap.ssl.onhandshakedone(_tls_wrap.js: 469: 38)

, .

. ..

C:\Users\Sam\AppData\Local\Temp\phantomjs\

.

    PhantomJS not found on PATH                                                                                                
Download already available at C:\Users\sam\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip                    
Verified checksum of previously downloaded file                                                                            
Extracting zip contents                                    
+1

:

process.env["NODE_TLS_REJECT_UNAUTHORIZED"]

: ssl- node.js https.request?

0

All Articles