React Native STUCK starting packager
Asked Answered
H

6

18

For some reason when I want to start my React Native project, it's stucks at 'Starting Packager...' part. I tried to delete the node packages, and reinstall them, intall them via yarn, npm, but no luck. I got no idea how should I fix this :/ (so awkward)

Handwork answered 6/6, 2018 at 15:46 Comment(2)
where are you running the command? sometimes IDE terminals get bugged – Binder
if all the above methods fail, you can try this: visit here. – Abiogenetic
L
28

I had the same issue. I solved it by changing react-native-scripts version from "^1.14.1" to "1.14.0" and run npm install again.

Lordling answered 6/6, 2018 at 21:2 Comment(3)
After a lot of time spent finally got fixed issue with this. Thanks – Steamroller
Thank you! πŸ‘πŸ‘πŸ‘ Worked like a charm! – Brett
In my case, I had to do this as well as npm install [email protected] for it to work. – Sextain
A
13

after a long search I found a solution for this problem:

this problem is caused by another watchman process, to solve it you have to turn off the watchman process

first,check react,react-native,and expo version are they compatible, goto here

Then you must install watchman, goto https://facebook.github.io/watchman/docs/install.html. Check watchman has installed by:

watchman -v

result:

4.9.4

After that, type in terminal or cmd:

watchman watch-del-all

result:

{
"version": "4.9.4",
"roots": [
    "C:/Users/***/Documents/Project/quickCountAndroidCrna"
]

}

look in the "roots" section:

"roots": [
    "C:/Users/***/Documents/Project/quickCountAndroidCrna"
]

if "roots" not empty, you must shutdown watchman process, typing this in terminal or cmd:

watchman shutdown-server

result:

{
"version": "4.9.4",
"shutdown-server": true

}

run again watchman watch-del-all you will get result with empty roots like this:

{
"version": "4.9.4",
"roots": []

}

after that you can run npm start or yarn start or other command to start your react-native project.

if the problem still occurs, repeat the above method several times, make sure the "roots" are empty! in my case, even I had to repeat it up to 3 times.

Abiogenetic answered 30/8, 2018 at 0:1 Comment(0)
G
8

There could be multiple reasons for the issue. For the most recent version of react-native (Aug 2018), what you might need to do is just press 'q', it will displays the QR code.

After that, you use the expo app scan the QR code, it should start to bundle the scripts and load it to your phone.

If not, you might have another issue which is caused by the incompatibility among React-Native, React and Expo. If you are using Expo 27, you should use reactive-native 0.55.

There is a complete matrix here, https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md

Anyone who face problem after running npm audit fix, that is because it will try to install react-native 0.56 which doesn't work with Expo 27 well. So don't run npm audit fix. Just run npm install [email protected]. (As time progress, the version might be different. Make sure you follow the link above to find out the compatible versions.)

Gawky answered 4/8, 2018 at 13:36 Comment(1)
Had the version incompatibility. Worked perfectly after following this answer and doing npm install [email protected] and skipping npm audit fix. – Maas
C
2

There's a fastest way that worked for me:

When it says "Starting packager..."
press the "q" key. To show QR code

Certified answered 7/8, 2020 at 18:17 Comment(0)
S
2

In my case (React Native 0.62.2) however, yarn ios equivalent to react-native run-ios was stuck (silently) as the dedicated port (8081) was reserved by previously running process.

I only found that out when I tried running yarn startequivalent to react-native start

I had to kill it kill -9 $(lsof -t -i:8081 -sTCP:LISTEN) and run yarn ios to get ios simulator back and running.

Every case is different and I Hope this helps someone.

Siva answered 24/9, 2020 at 4:42 Comment(0)
F
0

If you're still having this issue, its very likely that there's some other program running on port 8081.

Killing this program fixed the issue for me.

Financial answered 28/6, 2023 at 8:24 Comment(0)

© 2022 - 2024 β€” McMap. All rights reserved.