1

I have been stuck for two days now, I am trying to setup react-native, everything is in place: Up to-date Android Studio, Genymotion, paths and I followed all the guidance on https://facebook.github.io/react-native/docs/getting-started.html.

When I run "react-native run-android" or "react-native start", I get the following error:

C:\Users\Pc\Desktop\Bot>react-native run-android The system cannot find the path specified. child_process.js:512 throw err; ^

Error: Command failed: C:\Users\Pc\Desktop\Bot\node_modules\react-native\local-cli\setup_env.bat The system cannot find the path specified.

at checkExecSyncError (child_process.js:489:13)
at Object.execFileSync (child_process.js:509:13)
at Object.run (C:/Users/Pc/Desktop/Bot/node_modules/react-native/local-cli/cliEntry.js:136:16)
at Object.<anonymous> (C:\Users\Pc\AppData\Roaming\npm\node_modules\react-native-cli\index.js:117:7)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)

C:\Users\Pc\Desktop\Bot>react-native start The system cannot find the path specified. child_process.js:512 throw err; ^

Error: Command failed: C:\Users\Pc\Desktop\Bot\node_modules\react-native\local-cli\setup_env.bat The system cannot find the path specified.

at checkExecSyncError (child_process.js:489:13)
at Object.execFileSync (child_process.js:509:13)
at Object.run (C:/Users/Pc/Desktop/Bot/node_modules/react-native/local-cli/cliEntry.js:136:16)
at Object.<anonymous> (C:\Users\Pc\AppData\Roaming\npm\node_modules\react-native-cli\index.js:117:7)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
Nompumelelo
  • 929
  • 3
  • 17
  • 28
j33n
  • 49
  • 7
  • Finally managed by commenting the line on C:/Users/Pc/Desktop/Bot/node_modules/react-native/local-cli/cliEntry.js:136:16 – j33n Mar 11 '17 at 17:56

2 Answers2

0

Commenting a line on a file that is clearly configuring the react native client is a very bad idea. Try creating a new project from scratch. Maybe you forgot a step or the download broke and you have files missing.

sebastianf182
  • 9,844
  • 3
  • 34
  • 66
  • Sometimes you have to edit the framework, don't be afraid to do it and remember react-native is still young so there may be bugs there too. – j33n Mar 13 '17 at 06:29
  • Did you check which line you commented? Its the one that pre configures the whole react-native-cli.... – sebastianf182 Mar 13 '17 at 20:12
0

Somewhere the environmental path for the react-native command didn't get set correctly.

Did you install the react-native-CLI globally? Like:

$ npm install -g react-native-cli

Make sure the path to the Java variable is set properly. Right-click the start menu and select: system->Advanced system settings->environmental variables... The path should go to the bin folder in the JDK.

Also, make sure your ANDROID_HOME variable is set properly. See this question:

Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.

Community
  • 1
  • 1
Adam Patterson
  • 958
  • 7
  • 13