当我从Mac运行此命令时,
npx @react-native-community/cli doctor
我得到了这个有趣的无法识别的Java版本:
Common
✓ Node.js
✓ yarn
✓ Watchman - Used for watching changes in the filesystem when in development mode
Android – JDK
执行时:
react-native info
我知道了:
info正在获取系统和库信息...
System:
OS: macOS 10.15.5
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 226.40 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.2 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /Users/emmanuelharel/.gem/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 28, 30
Build Tools: 28.0.3, 29.0.2, 30.0.0
System Images: android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_242-release - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: ~16.11.0 => 16.11.0
react-native: ~0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
有人知道为什么对本地cli做出反应无法使Java 1.8和8是“相同的”吗?
答案 0 :(得分:0)
见https://github.com/react-native-community/cli/issues/1255 有一个 pull request #1395 只是为了修复它,所以它可能很快就会被接受并进入补丁。