react native 初始化项目报错,.还没找到到过正确的解决方案



  • D:\Program Files\nodejs\AwesomeProject>react-native run-android
    info Starting JS server...
    info Installing the app...
    :ReactNative:Cannot run program "./node_modules/.bin/react-native" (in directory "D:\Program Files\nodejs\AwesomeProject\android.."): CreateProcess error=2, 系统找不到指定的文件。
    :ReactNative:Automatic import of native modules failed.

    Configure project :app
    :ReactNative:Cannot run program "./node_modules/.bin/react-native" (in directory "D:\Program Files\nodejs\AwesomeProject\android.."): CreateProcess error=2, 系统找不到指定的文件。
    :ReactNative:Automatic import of native modules failed.

    Task :app:installDebug
    04:42:32 V/ddms: execute: running am get-config
    04:42:32 V/ddms: execute 'am get-config' on 'bdbad43d' : EOF hit. Read: -1
    04:42:32 V/ddms: execute: returning
    Installing APK 'app-debug.apk' on 'Redmi Note 7 Pro - 9' for app:debug
    04:42:32 D/app-debug.apk: Uploading app-debug.apk onto device 'bdbad43d'
    04:42:32 D/Device: Uploading file onto device 'bdbad43d'
    04:42:32 D/ddms: Reading file permision of D:\Program Files\nodejs\AwesomeProject\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------
    04:42:33 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
    04:42:38 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'bdbad43d' : EOF hit. Read: -1
    04:42:38 V/ddms: execute: returning
    04:42:38 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
    04:42:38 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'bdbad43d' : EOF hit. Read: -1
    04:42:38 V/ddms: execute: returning
    Installed on 1 device.

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
    Use '--warning-mode all' to show the individual deprecation warnings.
    See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

    BUILD SUCCESSFUL in 7s
    27 actionable tasks: 2 executed, 25 up-to-date
    info Connecting to the development server...
    info Starting the app on "bdbad43d"...
    Starting: Intent { cmp=com.awesomeproject/.MainActivity }



  • 我遇到同样的问题