Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native(root is missing ) while running application

Tags:

react-native

After creating react native app when i used to run this using react-native run-android that time i am getting error as root missing

error Option "--root" is missing. Run CLI with --verbose flag for more details. Error: Option "--root" is missing at C:\Users\Mayuri\AppData\Roaming\npm\node_modules\react-native\node_modules@react-native-community\cli\build\tools\assertRequiredOptions.js:51:13

enter image description here

like image 383
Mayuri Gaikwad Avatar asked Mar 23 '21 13:03

Mayuri Gaikwad


People also ask

How to run react native app on Android device?

Running your app on Android devices 1 Enable Debugging over USB Most Android devices can only install and run apps downloaded from Google Play, by default. ... 2 Plug in your device via USB Let's now set up an Android device to run our React Native projects. ... 3 Run your app

Why can't I run React-Native project in root folder?

That should do it This error simply means you don't have 'android' and 'ios' folders in your root directory of the project. Their location is important. Open your project folder search for 'android' and iso 'folder', move these folders in your root folder of the project and then start the project with react-native run-android

How do I Find my device's IP address in React Native?

Open the command prompt and type ipconfig to find your machine's IP address ( more info ). Make sure your laptop and your phone are on the same Wi-Fi network. Open your React Native app on your device. You'll see a red screen with an error.

How to fix React-Native Command is not working?

Actually running react-native upgrade command restore those files, thus fixing the problem. As a complement, in the case react-native command is not found, you should install react-native CLI: Then you can follow the steps people said above.


1 Answers

If you are using the latest version of react-native 64 and npm greater than 5.2 you need to execute your packages using npx command so rather than running

react-native run-android 

run

npx react-native run-android
like image 54
Sandeep Kundu Avatar answered Oct 22 '22 21:10

Sandeep Kundu