Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何为windows运行react native?我有一个问题:npx反应本机运行android错误_Javascript_Node.js_React Native_Android Studio_React Native Android - Fatal编程技术网

Javascript 如何为windows运行react native?我有一个问题:npx反应本机运行android错误

Javascript 如何为windows运行react native?我有一个问题:npx反应本机运行android错误,javascript,node.js,react-native,android-studio,react-native-android,Javascript,Node.js,React Native,Android Studio,React Native Android,我想运行React本机项目。我已经试过这个命令了;npx反应本机运行android和。我试图解决所有错误,但仍然无法运行该项目。这是错误输出 我刚刚猜到了有用的消息布局-请检查一个,不要犹豫,重新开始,在代码栏之间粘贴一个新的副本(行中只有~)。 PS C:\Users\batuh\OneDrive\Masaüstü\native\androidApp> npx react-native run-android info Running jetifier to migrate librar

我想运行React本机项目。我已经试过这个命令了;npx反应本机运行android和。我试图解决所有错误,但仍然无法运行该项目。这是错误输出

我刚刚猜到了有用的消息布局-请检查一个,不要犹豫,重新开始,在代码栏之间粘贴一个新的副本(行中只有
~
)。
PS C:\Users\batuh\OneDrive\Masaüstü\native\androidApp> npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 903 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\@react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\@react-native-community\cli\build\bin.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 205

* What went wrong:
A problem occurred evaluating script.
node:internal/modules/cjs/loader:927
  throw err;
  ^Error: Cannot find module 'C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\@react-native-community\cli\build\bin.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)  
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {  code: 'MODULE_NOT_FOUND',  requireStack: []}

* 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 3s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\@react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\@react-native-community\cli\build\bin.js, config]' command failed.

FAILURE: Build failed with an exception.

Script 'C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 205

* What went wrong:
A problem occurred evaluating script.
node:internal/modules/cjs/loader:927
  throw err;
  ^Error: Cannot find module 'C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\@react-native-community\cli\build\bin.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {  code: 'MODULE_NOT_FOUND',  requi
* 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 3s

    at makeError (C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\execa\index.js:174:9)
    at C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async runOnAllDevices (C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
    at async Command.handleAction (C:\Users\batuh\OneDrive\Masaüstü\native\androidApp\node_modules\@react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.