'Cannot find module node_modules\@react-native-community\cli\build\bin.js'
After using expo eject i tried to run my app on android emulator:
PS C:\Users\becim\OneDrive\Počítač\test> yarn android
yarn run v1.22.5
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1296 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\becim\OneDrive\Počítač\test\node_modules\@react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\becim\OneDrive\Počítač\test\node_modules\@react-native-community\cli\build\bin.js, config]' command failed.
FAILURE: Build failed with an exception.
Where: Script 'C:\Users\becim\OneDrive\Po��ta�\test\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 195
What went wrong: A problem occurred evaluating script.
node:internal/modules/cjs/loader:928 throw err; ^Error: Cannot find module 'C:\Users\becim\OneDrive\PoÄŤĂtaÄŤ\test\node_modules@react-native-community\cli\build\bin.js' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15) at Function.Module._load (node:internal/modules/cjs/loader:769:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) at node:internal/main/run_main_module:17: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. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 :ReactNative:Unexpected empty result of running '[node, C:\Users\becim\OneDrive\Počítač\test\node_modules@react-native-community\cli\build\bin.js, config]' command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Any solution to this?
Solution 1:[1]
Delete your node modules directory and run this command :
npm install
Solution 2:[2]
It is happening because of your path. Move your project to english-based path
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Gaby |
Solution 2 | AuroPick |