React-native run-android failing

I have been stuck for two days now, I am trying to setup react-native, everything is in place: Uptodate 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)

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.

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.

Comments

Popular posts from this blog

flutter websocket connection issue

Webpack 5 and Storybook 6 integration throws an error in DefinePlugin.js

Meaning of `{}` for return expression