You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native项目升级Expo至48.0.4后出现模块缺失等报错求助

问题:Expo从~43.0.2升级至^48.0.4后启动失败报错

将React Native项目中的Expo版本从~43.0.2升级至^48.0.4后,项目无法正常运行,~43.0.2版本可正常启动。使用yarn add expo命令安装对应版本,报错信息如下:

WARN No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?
ERROR Error: Expo native runtime is not available: something went wrong and we aren't sure what it was. Please post more information and get support at https://forums.expo.dev.
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

解决方案

  • 清理依赖缓存并重装依赖:执行yarn cache clean,删除项目根目录下的node_modules文件夹和yarn.lock文件,再重新运行yarn install
  • 匹配expo-constants版本:Expo 48对应expo-constants的兼容版本为^14.2.1,执行yarn add expo-constants@^14.2.1确保依赖适配
  • 检查入口文件配置:确认app.json中的entryPoint字段指向正确的项目入口文件(如index.js或App.js)
  • 清除Expo缓存:执行expo r -c重启项目并清除本地缓存
  • 排查第三方依赖兼容性:Expo 48要求React Native版本为0.71.x,检查项目中其他第三方依赖是否适配该版本,必要时更新或替换不兼容的依赖

内容的提问来源于stack exchange,提问作者andonirj

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.30 10:00:02