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

React Native Unimodules废弃困惑:RN CLI项目是否需迁移Expo模块升级expo-camera

疑问解答

  1. 要使用最新版expo-camera,确实需要从已废弃的react-native-unimodules迁移到Expo Modules体系
  2. Expo Modules并不只支持Expo CLI项目,完全兼容React Native CLI创建的原生项目

原因说明

从Expo SDK 43开始,官方已正式废弃react-native-unimodules,原有unimodules生态全部整合到新的Expo Modules体系中,核心依赖替换为expo包,官方废弃提示原文如下:

This library is deprecated!
As of Expo SDK 43, react-native-unimodules is deprecated in favor of the expo package. Please refer to the Installing Expo modules guide.

你升级expo-camera后收到的重复包提示:

Found some duplicated unimodule packages. Installed the ones with the highest version number.

是新版expo-camera基于新的Expo Modules开发,和你项目中安装的旧react-native-unimodules产生依赖冲突导致的。

处理方案

你无需将现有项目切换为Expo CLI管理,只需在当前React Native CLI项目中完成Expo Modules的基础配置,卸载旧的react-native-unimodules依赖后,再升级expo-camera到最新版本即可正常使用,不会再出现重复包冲突提示。


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.09.26 06:36:07