expo init fails when self signed certificate in chain

I have been trying to create a new project with expo init and am unable to do that.

Since I have self signed corporate certificates in the chain, I tried doing multiple things.
I tried setting the following variables

set NODE_TLS_REJECT_UNAUTHORIZED=0
npm config set strict-ssl false
C:\localDev>expo init AwesomeProject
? Choose a template: expo-template-tabs
(node:420) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
request to https://registry.npmjs.org/expo-template-tabs failed, reason: self signed certificate in certificate chain
FetchError: request to https://registry.npmjs.org/expo-template-tabs failed, reason: self signed certificate in certificate chain
    at ClientRequest.<anonymous> (...npm\node_modules\expo-cli\node_modules\minipass-fetch\lib\index.js:97:14)
    at ClientRequest.emit (events.js:314:20)
    at TLSSocket.socketErrorListener (_http_client.js:469:9)
    at TLSSocket.emit (events.js:326:22)
    at emitErrorNT (internal/streams/destroy.js:100:8)
    at emitErrorCloseNT (internal/streams/destroy.js:68:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

Logs from Expo diagnostic…

Expo CLI 3.24.0 environment info:
System:
OS: Windows 10 10.0.17763
Binaries:
Node: 14.5.0 - C:\Program Files\nodejs\node.EXE
npm: 6.14.7 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 4.0.0.0 AI-193.6911.18.40.6626763

While searching on the internet, found the following issue

Not sure if this is related, but it definitely is causing an issue and is quite similar.

PS. I have asked the same question in stackoverflow also… If I get answer anywhere, I will update the other space myself.https://stackoverflow.com/questions/63435943/expo-init-failed-with-ssl-error-self-signed-certificate-in-certificate-chain

It sounds like there’s a transparent proxy between you and the Internet.

I think the norm would be for them to set up a CA and automatically sign web site certificates as you browse. If so they likely install the CA certificate as a trusted CA.

If the above is correct for your situation then it would be best to get the CA cert, e.g. from your browser and tell node about the trusted cert.

https://nodejs.org/api/cli.html#cli_node_extra_ca_certs_file

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.