1It might because the localhost is not defined with the required syntax in the "hosts" file of the system.
2The file can be located @:
3
4=> $ sudo nano /private/etc/hosts (iOS)
5https://www.alphr.com/edit-hosts-file-mac-os-x/
6
7=> etc/hosts
8(above file for linux)
9
10=> c:\ Windows \System32\Drivers\ etc \ hosts
11(above file for Windows)
12
13i.e. file has some wrong input.
14
15So, 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:
16
17127.0.0.1 localhost
18255.255.255.255 broadcasthost
19::1 localhost
20fe80::1%lo0 localhost
21
22Source
23https://github.com/expo/expo-cli/issues/1238