mj225
mj225

Reputation: 1

(node:2046) UnhandledPromiseRejectionWarning: RangeError [ERR_SOCKET_BAD_PORT] [ERR_SOCKET_BAD_PORT]: Port should be >= 0 and < 65536. Received 65536

I just created a new React Native project using expo. I ran yarn start without changing any code and am getting this error. I am running the most recent version of React Native and Expo. I have been trying to fix this for days now and am completely lost as to what to do. I have tried reverting to older versions of React and Expo and still no luck.

Also I am using a Mac computer.

Upvotes: 0

Views: 1364

Answers (1)

Zouhair Jabiri
Zouhair Jabiri

Reputation: 25

It might be coz the localhost is not defined with the required syntax in the "hosts" file of the system. The file can be located @:

=> etc/hosts (above file for linux) or => c:\ Windows \System32\Drivers\ etc \ hosts (above file for Windows)

i.e. file has some wrong input.

So, Try replacing everything in that file with the text below as this is the default text that was always there in hosts file when it worked fine:

127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost

Upvotes: 1

Related Questions