React native(root is missing ) while running application

Viewed 3154

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

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
Related