这是我package.json的依赖项:
"dependencies": {
...
"react": "16.6.0-alpha.8af6728",
"react-native": "0.57.4",
"react-navigation": "^3.2.3",
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.49.0",
"react-test-renderer": "16.6.0-alpha.8af6728"
},
当我运行命令npm时,它告诉我必须运行npm audit fix:
found 69 low severity vulnerabilities in 37658 scanned packages
run `npm audit fix` to fix 6 of them.
63 vulnerabilities require semver-major dependency updates.
我在列表中有这个:
# Run npm install jest@24.3.1 to resolve 62 vulnerabilities
SEMVER WARNING: Recommended action is a potentially breaking change
...
# Run npm install react-native@0.58.6 to resolve 2 vulnerabilities
...
# Run npm install babel-jest@24.3.1 to resolve 1 vulnerability
SEMVER WARNING: Recommended action is a potentially breaking change
我使用gradle 4.8和openjdk 11.0.1
当我运行react-native run-android时,出现错误...
Deprecated Gradle features were used in this build, making it incompatible
with Gradle 5.0.
See https://docs.gradle.org/4.8/userguide/command_line_interface.html
#sec:command_line_warnings
BUILD FAILED in 8s
29 actionable tasks: 7 executed, 22 up-to-date
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/getting-started.html
Command failed: gradlew.bat installDebug
Error: Command failed: gradlew.bat installDebug
at checkExecSyncError (child_process.js:611:11)
at Object.execFileSync (child_process.js:629:13)
at runOnAllDevices (D:\WORKSPACES_REACT_NATIVE\LG\node_modules\react-
native\local-cli\runAndroid\runAndroid.js:299:19)
at buildAndRun (D:\WORKSPACES_REACT_NATIVE\LG\node_modules\react-
native\local-cli\runAndroid\runAndroid.js:135:12)
at isPackagerRunning.then.result
(D:\WORKSPACES_REACT_NATIVE\LG\node_modules\react-native\local-
cli\runAndroid\runAndroid.js:65:12)
at process._tickCallback (internal/process/next_tick.js:68:7)