Reputation: 107
I am now using react native cli in my crud project,but after I initialized the project and ran npx react-native run-android inside project folder
it gave me these errors :
npx react-native run-android
info Starting JS server...
* daemon not running; starting now at tcp:5037
* daemon started successfully
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\invis\OneDrive\�?rea de Trabalho\reac\app\node_modules\@react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\invis\OneDrive\�?rea de Trabalho\reac\app\node_modules\@react-native-community\cli\build\bin.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\invis\OneDrive\�rea de Trabalho\reac\app\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 413
* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:988 throw err; ^Error: Cannot find module 'C:\Users\invis\OneDrive\�rea de Trabalho\reac\app\node_modules\@react-native-community\cli\build\bin.js' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15) at Function.Module._load (node:internal/modules/cjs/loader:833:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:22:47 { code: 'MODULE_NOT_FOUND', requireStack: []}
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\invis\OneDrive\�?rea de Trabalho\reac\app\node_modules\@react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\invis\OneDrive\�?rea de Trabalho\reac\app\node_modules\@react-native-community\cli\build\bin.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\invis\OneDrive\�rea de Trabalho\reac\app\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 413
* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:988 throw err; ^Error: Cannot find module 'C:\Users\invis\OneDrive\�rea de Trabalho\reac\app\node_modules\@react-native-community\cli\build\bin.js' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15) at Function.Module._load (node:internal/modules/cjs/loader:833:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:22:47 { code: 'MODULE_NOT_FOUND', requireStack: []}
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
at makeError (C:\Users\invis\OneDrive\Área de Trabalho\reac\app\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\invis\OneDrive\Área de Trabalho\reac\app\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\invis\OneDrive\Área de Trabalho\reac\app\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\invis\OneDrive\Área de Trabalho\reac\app\node_modules\@react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.
At first I installed react native and react-native-community-cli globally and I saw it was a bad practice so I uninstalled it globally and installed again but now locally
I saw in a website the command
react-native doctor And I saw at first some problems with SDK so I installed all packages necessary and it still AFTER ALL THIS gives me the same error again and again I also tried deleting node modules ang installing again with npm install
but unfortunately it did not work,if anyone has any ideas please send it ,I will be very grateful !!!
Upvotes: 0
Views: 725
Reputation: 107
After A LOT of research,I found out that because my path system is written in portuguese ,my desktop is named "Área de Trabalho" ,it did not worked,I changed it to OneDrive directory which is 1 level upper in the directory tree and it DID worked fine!!! Hope I helped someone with the same problem!!! Have a good day !!!
Upvotes: 1