通过 Expo 的脚手架expo-cli搭建的项目,连接安卓设备或者expo start --android时候会报这个错误
Error: Unable to resolve module \`./node\_modules\\expo\\AppEntry\` from \`\`: None of these files exist: \* node\_modules\\expo\\AppEntry(.native|.android.expo.ts|.native.expo.ts|.expo.ts|.android.expo.tsx|.native.expo.tsx|.expo.tsx|.android.expo.js|.native.expo.js|.expo.js|.android.expo.jsx|.native.expo.jsx|.expo.jsx|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.wasm|.native.wasm|.wasm) \* node\_modules\\expo\\AppEntry\\index(.native|.android.expo.ts|.native.expo.ts|.expo.ts|.android.expo.tsx|.native.expo.tsx|.expo.tsx|.android.expo.js|.native.expo.js|.expo.js|.android.expo.jsx|.native.expo.jsx|.expo.jsx|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.wasm|.native.wasm|.wasm) at ModuleResolver.resolveDependency (F:\\Project\\BluetoothTool\\node\_modules\\\_metro@0.56.4@metro\\src\\node-haste\\DependencyGraph\\ModuleResolution.js:163:15) at ResolutionRequest.resolveDependency (F:\\Project\\BluetoothTool\\node\_modules\\\_metro@0.56.4@metro\\src\\node-haste\\DependencyGraph\\ResolutionRequest.js:52:18) at DependencyGraph.resolveDependency (F:\\Project\\BluetoothTool\\node\_modules\\\_metro@0.56.4@metro\\src\\node-haste\\DependencyGraph.js:282:16) at F:\\Project\\BluetoothTool\\node\_modules\\\_metro@0.56.4@metro\\src\\lib\\transformHelpers.js:267:42 at Server.<anonymous> (F:\\Project\\BluetoothTool\\node\_modules\\\_metro@0.56.4@metro\\src\\Server.js:1088:41) at Generator.next (<anonymous>) at asyncGeneratorStep (F:\\Project\\BluetoothTool\\node\_modules\\\_metro@0.56.4@metro\\src\\Server.js:99:24) at \_next (F:\\Project\\BluetoothTool\\node\_modules\\\_metro@0.56.4@metro\\src\\Server.js:119:9)
package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "~10.0.6",
"@react-native-community/masked-view": "0.1.6",
"@react-navigation/bottom-tabs": "^5.0.0",
"@react-navigation/native": "^5.0.0",
"@react-navigation/stack": "^5.0.0",
"@react-navigation/web": "~1.0.0-alpha.9",
"expo": "~37.0.3",
"expo-asset": "~8.1.3",
"expo-constants": "~9.0.0",
"expo-font": "~8.1.0",
"expo-web-browser": "~8.1.0",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "./react-native-sdk-37.0.1.tar.gz",
"react-native-gesture-handler": "~1.6.0",
"react-native-safe-area-context": "0.7.3",
"react-native-screens": "~2.2.0",
"react-native-web": "~0.11.7"
},
"devDependencies": {
"@babel/core": "^7.8.6",
"babel-preset-expo": "~8.1.0",
"jest-expo": "~37.0.0"
},
"private": true
}
app.json
{
"expo": {
"name": "BluetoothTool",
"slug": "BluetoothTool",
"platforms": ["ios", "android", "web"],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
}
}
}