resolve module `./node_modules\expo\AppEntry` from ``

发布于 2022-09-12 02:14:42 字数 3783 浏览 24 评论 0

通过 Expo 的脚手架expo-cli搭建的项目,连接安卓设备或者expo start --android时候会报这个错误
QQ浏览器截图20200416092725.png

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
    }
  }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文