【问题标题】:How can i fix 'npx react-native run-android' error?如何修复“npx react-native run-android”错误?
【发布时间】:2020-11-16 21:43:00
【问题描述】:

我使用 'npx react-native run-android' 命令并收到此错误:

Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
:ReactNative:Unexpected empty result of running '[node, C:\Users\aisir\OneDrive\Рабочий стол\RNTestWithNode\clientRN\node_modules\@react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\aisir\OneDrive\Рабочий стол\RNTestWithNode\clientRN\node_modules\@react-native-community\cli\build\bin.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\aisir\OneDrive\������� ����\RNTestWithNode\clientRN\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 195

* What went wrong:
A problem occurred evaluating script.
> internal/modules/cjs/loader.js:968  throw err;  ^Error: Cannot find module 'C:\Users\aisir\OneDrive\Рабочий стол\RNTestWithNode\clientRN\node_modules\@react-native-community\cli\build\bin.js'    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)    at Function.Module._load (internal/modules/cjs/loader.js:841:27)    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)    at internal/main/run_main_module.js: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 6s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\aisir\OneDrive\Рабочий стол\RNTestWithNode\clientRN\node_modules\@react-native-community\cli\build\bin.js, config]' command.

有人知道怎么解决吗?

【问题讨论】:

  • 从您发布的错误中可以清楚地看出,Рабочий стол 被视为������� ����Рабочий стол,所以问题出在代码页/字体/编码上。

标签: android react-native cmd emulation device


【解决方案1】:

我找到了解决方法。我更改了项目的版本。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-02-22
    • 1970-01-01
    • 1970-01-01
    • 2021-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多