Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FetchError: request to https://api.expo.dev/v2/sdks/49.0.0/native-modules failed, reason: read ECONNRESET error in running react native

I have an application file of react native that was running fine in vs code before but now whenever I tried to run it gives this error. I try to run it by PS C:\User\Desktop\ReactNativeApp> npx expo start

Starting Metro Bundler

`FetchError: request to https://api.expo.dev/v2/sdks/49.0.0/native-modules failed, reason: 
 read ECONNRESET
 FetchError: request to https://api.expo.dev/v2/sdks/49.0.0/native-modules failed, reason: 
 read ECONNRESET
  at ClientRequest.<anonymous> (C:\User\Desktop\ReactNativeApp\node_modules\node- 
  fetch\lib\index.js:1501:11)

at ClientRequest.emit (node:events:513:28)
at TLSSocket.socketErrorListener (node:_http_client:502:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)`

I have tried restarting and even create a new project but it is giving the same error. How can I do to resolve this error?

like image 632
M Baig Avatar asked May 09 '26 06:05

M Baig


2 Answers

Start your server with

npx expo start -c

inside your terminal

-c is short for --clear

like image 185
A. Lawal Avatar answered May 12 '26 11:05

A. Lawal


This problem is probably a network problem.

  1. Parse this (api.expo.dev) domain name and get the IP address.
  2. Edit hosts file
$ vim /etc/hosts
  1. Add a line
$ 104.18.4.104 api.expo.dev
  1. If you are using proxy, execute these two commands.
$ export HTTP_PROXY=http://your_proxy_address:your_proxy_port
$ export HTTPS_PROXY=http://your_proxy_address:your_proxy_port
like image 37
tamding dojee Avatar answered May 12 '26 10:05

tamding dojee