似乎 Metro Bundler 没有加载......它正在打开和关闭,我看不到在关闭之前没有任何东西在里面运行。出于这个原因,模拟器没有运行应用程序。
运行后出现错误:
反应原生初始化项目
react-native run-android
**System:**
OS: Windows 10
CPU: (2) x64 AMD A4-6300 APU with Radeon(tm) HD Graphics
Memory: 1.49 GB / 7.21 GB
Binaries:
Node: 12.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.19.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 23, 27, 28
Build Tools: 23.0.1, 27.0.3, 28.0.3
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5900203
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.3 => 0.61.3
包.json
{
"name": "first_app",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.9.0",
"react-native": "0.61.3"
},
"devDependencies": {
"@babel/core": "^7.6.4",
"@babel/runtime": "^7.6.3",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.6.0",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.3",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}