react-native run-android报错

来源:1-5 项目底部导航菜单开发

WDF_

2017-08-28

D:\ReactNative\App>react-native run-android

Scanning 556 folders for symlinks in D:\ReactNative\App\node_modules (28ms)

Starting JS server...

Building and installing the app on the device (cd android && gradlew.bat installDebug)...


ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.


Please set the JAVA_HOME variable in your environment to match the

location of your Java installation.

Could not install the app on the device, read the error above for details.

Make sure you have an Android emulator running or a device connected and have

set up your Android development environment:

https://facebook.github.io/react-native/docs/android-setup.html

events.js:160

      throw er; // Unhandled 'error' event

      ^


Error: spawn cmd.exe ENOENT

    at exports._errnoException (util.js:1020:11)

    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)

    at onErrorNT (internal/child_process.js:367:16)

    at _combinedTickCallback (internal/process/next_tick.js:80:11)

    at process._tickCallback (internal/process/next_tick.js:104:9)


写回答

1回答

CrazyCodeBoy

2017-08-30

看log,你的是Windows系统? 看JAVA_HOME等环境变量是不是忘记了设置了呢?

0
1
WDF_
非常感谢!
2017-08-30
共1条回复

React Native技术精讲与高质量上线App开发

一个真实的上线项目,一次完整的开发过程,全面掌握React Native技术

1577 学习 · 727 问题

查看课程