Reputation: 57
i m new in react native.. when i was run my app following error occurred in command line. Kindly guide me with an appropriate solution... Thanks.
FAILURE: Build failed with an exception.
Where: Script 'E:\My Final Year Project\Home_Page\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 170
What went wrong: A problem occurred evaluating script.
internal/modules/cjs/loader.js:797 throw err; ^Error: Cannot find module '@react-native-community/cli'Require stack:- E:\My Final Year Project\Home_Page\android[eval] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15) at Function.Module._load (internal/modules/cjs/loader.js:687:27) at Module.require (internal/modules/cjs/loader.js:849:19) at require (internal/modules/cjs/helpers.js:74:18) at [eval]:1:13 at Script.runInThisContext (vm.js:116:20) at Object.runInThisContext (vm.js:306:38) at Object. ([eval]-wrapper:9:26) at Module._compile (internal/modules/cjs/loader.js:956:30) at evalScript (internal/process/execution.js:80:25) { code: 'MODULE_NOT_FOUND', requireStack: [ 'E:\My Final Year Project\Home_Page\android\[eval]' ]}
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 36s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 :ReactNative:Unexpected empty result of running 'node -e console.log(require('@react-native-community/cli').bin);' command. :ReactNative:Running 'node -e console.log(require('@react-native-community/cli').bin);' command failed.
Upvotes: 1
Views: 6573
Reputation: 43
This happened to me with react-native 0.61.5 and cli version 1.0.9.
Updating @react-native-community/cli worked for me.
$ npm install @react-native-community/[email protected]
Upvotes: 1
Reputation: 582
There was a bad release of v1.9.6, which was fixed in 1.9.7. Try updating it
OR i would suggest you to install yarn and then run
yarn install
Upvotes: 2
Reputation: 538
Read over the react-native getting started docs again. It seem like you missed a step. The error is saying you are missing @react-native-community/cli
module which should have been added during your initial react-native environment set up.
Upvotes: 1