skip to Main Content

I am trying to start a new react native expo app by executing
npx expo start but it throws following error

FetchError: request to https://api.expo.dev/v2/sdks/51.0.0/native-modules failed, reason: unable to get local issuer certificate

FetchError: request to https://api.expo.dev/v2/sdks/51.0.0/native-modules failed, reason: unable to get local issuer certificate
    at ClientRequest.<anonymous> (C:appexpo-appnode_modulesnode-fetchlibindex.js:1501:11)
    at ClientRequest.emit (node:events:519:28)
    at TLSSocket.socketErrorListener (node:_http_client:500:9)
    at TLSSocket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)

UPDATE

I am also getting same error when executing following command

npx expo install react-dom react-native-web @expo/metro-runtime

What could be the probably fix for this? Appreciate your advice.

2

Answers


  1. I was facing the same problem, somehow it got something with proxy or network relative thing.
    I using Linux Ubuntu and solve it by modify /etc/hosts .
    I just define the requested Domain there like this.

    127.0.0.1   localhost
    127.0.1.1   ArifKurdi
    104.18.4.104 api.expo.dev // The line I added in the file.
    

    and Its work fine after that.

    Login or Signup to reply.
  2. I’m on a company laptop, and I was able to resolve this by setting the NODE_EXTRA_CA_CERTS environment variable:

    How can I set NODE_EXTRA_CA_CERTS on node

    Some other solutions mentioned disabling TLS via NODE_TLS_REJECT_UNAUTHORIZED, but this doesn’t seem like a good idea for security reasons:

    Node Fetch Request Fails on Server: Unable to Get Local Issuer Certificate

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search