react-native: "run-android" stuck on JS Metro Bundler ("warn")

Today I created a new project with “react-native init projectName” and when I tried to “run-android” it runs Node JS server and stucks like first screenshot.

If I kill the JS server it gives the warn about packager server and contiunes to install app and gives Unable to load script error (for sure because JS server not running)

When I first type “react-native start” and “run-android” it works fine, but I want to know why it happens like that? I search that warn error and can’t find anything.

It’s start happening suddenly. I didn’t recieve that error on my old projects (same react and react native versions) and don’t know why it happens.

Any help?

1 2

Error:

warn Failed to automatically start the packager server. Please run "react-native start" manually. Error details: Command failed: cmd.exe /C C:\Users\ezran\Desktop\SADELABS\demoProject\node_modules\react-native\scripts\launchPackager.bat
nullnull

package.json

"react": "16.8.6", "react-native": "0.60.4"

System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
    Memory: 2.63 GB / 7.88 GB
  Binaries:
    Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    Android Studio: Version  3.4.0.0 AI-183.6156.11.34.5692245

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 31 (9 by maintainers)

Most upvoted comments

i have got the solution of the problem

  1. go to your project and run 2 command shell
  2. in first shell, run npm start
  3. in second shell, react-native run-android then it will run

Published fix in v2.8.3 of the CLI. Please update the @react-native-community/cli to the latest version.

If CLI is the problem how can work on older project? I mean it can be, maybe I was wrong, CLI has problem, but I don’t get it. I have two project which one of them created one week ago (0.60.4), one of them yesterday (0.60.4), older one works fine but the other has a problem.

Compare the CLI versions of both the projects using the command I gave you and you will see the difference. Each time you run react-native init, the latest CLI version is installed (locally not globally).

Yeah you were right, older project has “@react-native-community/cli@2.8.0”, newer one " @react-native-community/cli@2.8.1".

Sorry for not thinking problem on CLI, my bad. I don’t know very well CLI

Same problem, I tried to reinstall node, clear npm cache, etc …