1

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.

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

1

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]

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.