I am trying to run create-react-native-app on expo app in android.
Firstly ,I created the project by writing command
create-react-native-app t
First of all, disable the unused network connection. In my case it was VirtualBox. Maybe it's using the same port. I am not sure about that. after disabling the unused connections then restart the packager. if you used npm then type
npm start
This error beaus your port it is not open just check port is open or not for ubuntu you can check using the following way
sudo ufw status verbose
check 19000 port open then you need it then run following command if port not open
sudo ufw allow 19000/tcp
for other port runs following command
sudo ufw allow 19001/tcp
because http port not you are getting erro. above step solve your problem similar for mac and windows check firewall setting once
If you have tried everything the other answers suggest and it still does not work, please also check that your computer and your phone are connected to the same WIFI network. For me this is what wasted an hour.
I had the same issue after npm start script on windows environment. Putting mobile on the same network as my Windows development environment was solved issue.
Change your network settings:
This is due to not open port from your machine.
In Ubuntu Run In terminal
sudo ufw status verbose
To view open port if you cannot found 19000 port open then you need to open port using
sudo ufw allow 19000/tcp
and then again run
sudo ufw allow 19001/tcp
to serve http for react native i solve this problem in my ubuntu using this method. I hope this will help you.
To open a port in the Windows firewall for TCP access
On the Start menu, click Run
, type WF.msc
, and then click OK
.
In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule
in the action pane.
In the Rule Type dialog box, select Port, and then click Next.
In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the React port, such as 19000 for the default instance. Click Next.
In the Action dialog box, select Allow the connection, and then click Next.
In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Database Engine, and then click Next.
In the Name dialog box, type a name and description for this rule, and then click Finish.
Similarly you can open port 19001 too.