'Error in running npx react-native CLI in Android emulator

Getting error while running npx react-native CLI in Android emulator
command: npx react-native run-android

error: BUILD FAILED in 3s
    at makeError (D:\TestProject\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
    at D:\TestProject\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (D:\TestProject\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
    at async Command.handleAction (D:\TestProject\node_modules\@react-native-community\cli\build\index.js:192:9) info 
Run CLI with --verbose flag for more details.


Solution 1:[1]

you may have global react-native-cli installed, which causes name conflicts in react-native binary. Could you please remove global react-native-cli by running yarn global remove react-native-cli.

Please check this link regarding react-native-community https://github.com/react-native-community/cli/issues/838

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 Balu