Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

port 8081 already in use when "react-native run-ios"

Tags:

react-native

Yes i have read this but still don't know how to make it work. react native - Port 8081 already in use, packager is either not running or not running correctly Command /bin/sh failed with exit code 2

Originally i was doing this

1. react-native init Hello
2. react-native run-ios

Then hit this "port 8081 already in use".

Did read the react doc, https://facebook.github.io/react-native/docs/troubleshooting.html

1. cannot kill the process using 8081, it keeps on coming back,
   and i don't want to kill it
2. react-native start --port=8088
3. update node_modules/react-
native/React/React.xcodeproj/project.pbxproj file. Did it.

Where and which step should i run "react-native start --port=8088" ?

btw, i'm an average engineer, but if i cannot run the very 1st react-native sample in 2 hours, i just cannot see how it can fly, this is very annoying.

like image 996
user3552178 Avatar asked Dec 24 '22 13:12

user3552178


1 Answers

In RN 0.55 you can fix this with:

react-native start --port=1234

and then in a different window:

react-native run-ios --port 1234

Versions:

✗ react-native --version
react-native-cli: 2.0.1
react-native: 0.55.4
like image 78
jcollum Avatar answered Feb 27 '23 16:02

jcollum