upgrading-expo by expo/skills
npx skills add https://github.com/expo/skills --skill upgrading-expoBeta 版本使用 .preview 后缀(例如,55.0.0-preview.2),通过 @next 标签发布。
检查最新版本是否为 Beta:https://exp.host/--/api/v2/versions(在 expoVersion 中查找 -preview)
npx expo install expo@next --fix # 安装 beta 版
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
npx expo install expo@latest
npx expo install --fix
2. 运行诊断:npx expo-doctor
npx expo export -p ios --clear
rm -rf node_modules .expo
watchman watch-del-all
首先检查项目中是否存在 ios/ 和 android/ 目录。 如果两个目录都不存在,则项目使用持续原生生成(CNG),原生项目在构建时重新生成——请完全跳过本节和“为裸工作流清除缓存”部分。
如果升级需要原生变更:
npx expo prebuild --clean
这将重新生成 ios 和 android 目录。在运行此命令前,请确保项目不是裸工作流应用。
这些步骤仅适用于项目中存在 ios/ 和/或 android/ 目录的情况:
cd ios && pod install --repo-updatenpx expo run:ios --no-build-cachecd android && ./gradlew clean"experiments": { "reactCompiler": true } 来启用 React Compiler——它稳定且推荐使用app.json 中删除 sdkVersion,让 Expo 自动管理它package.json 中移除隐式包:@babel/core、babel-preset-expo、expo-constants。| 旧包 | 替代包 |
|---|---|
expo-av | expo-audio 和 expo-video |
expo-permissions | 各个包的权限 API |
@expo/vector-icons | expo-symbols(用于 SF Symbols) |
AsyncStorage | expo-sqlite/localStorage/install |
expo-app-loading | expo-splash-screen |
| expo-linear-gradient | experimental_backgroundImage + View 中的 CSS 渐变 |
迁移已弃用的包时,请在移除旧包之前更新所有代码用法。对于 expo-av,请参考迁移指南,将 Audio.Sound 转换为 useAudioPlayer,将 Audio.Recording 转换为 useAudioRecorder,并将 Video 组件转换为使用 useVideoPlayer 的 VideoView。
检查 package.json 是否排除了某些包:
{
"expo": { "install": { "exclude": ["react-native-reanimated"] } }
}
排除项通常是变通方法,升级后可能不再需要。请逐一审查。
检查 patches/ 目录中是否有任何过时的补丁。如果不再需要,请移除它们。
autoprefixer 在 SDK +53 中不再需要。将其从依赖项中移除,并检查 postcss.config.js 或 postcss.config.mjs,将其从插件列表中移除。postcss.config.mjs。移除冗余的 metro 配置选项:
experimentalImportSupport 在 SDK +54 中默认启用。EXPO_USE_FAST_RESOLVER=1 在 SDK +54 中已移除。自 SDK 55 起,用户可以选择使用 Hermes 引擎 v1 以获得更好的运行时性能。这需要在 expo-build-properties 配置插件中设置 useHermesV1: true,并且可能需要特定版本的 hermes-compiler npm 包。Hermes v1 将在未来的某个 SDK 版本中成为默认选项。
新架构默认启用,app.json 中的字段 "newArchEnabled": true 不再需要,因为它已是默认设置。自 SDK +53 起,Expo Go 仅支持新架构。
每周安装量
13.9K
代码仓库
GitHub 星标数
1.5K
首次出现
2026年1月19日
安全审计
安装于
opencode10.5K
github-copilot10.5K
codex10.3K
cursor10.0K
gemini-cli10.0K
amp8.3K
Beta versions use .preview suffix (e.g., 55.0.0-preview.2), published under @next tag.
Check if latest is beta: https://exp.host/--/api/v2/versions (look for -preview in expoVersion)
npx expo install expo@next --fix # install beta
npx expo install expo@latest
npx expo install --fix
2. Run diagnostics: npx expo-doctor
npx expo export -p ios --clear
rm -rf node_modules .expo
watchman watch-del-all
First check ifios/ and android/ directories exist in the project. If neither directory exists, the project uses Continuous Native Generation (CNG) and native projects are regenerated at build time — skip this section and "Clear caches for bare workflow" entirely.
If upgrading requires native changes:
npx expo prebuild --clean
This regenerates the ios and android directories. Ensure the project is not a bare workflow app before running this command.
These steps only apply when ios/ and/or android/ directories exist in the project:
cd ios && pod install --repo-updatenpx expo run:ios --no-build-cachecd android && ./gradlew clean"experiments": { "reactCompiler": true } to app.json — it's stable and recommendedapp.json to let Expo manage it automaticallypackage.json: @babel/core, babel-preset-expo, expo-constants.| Old Package | Replacement |
|---|---|
expo-av | expo-audio and expo-video |
expo-permissions | Individual package permission APIs |
@expo/vector-icons | expo-symbols (for SF Symbols) |
AsyncStorage | expo-sqlite/localStorage/install |
When migrating deprecated packages, update all code usage before removing the old package. For expo-av, consult the migration references to convert Audio.Sound to useAudioPlayer, Audio.Recording to useAudioRecorder, and Video components to VideoView with useVideoPlayer.
Check if package.json has excluded packages:
{
"expo": { "install": { "exclude": ["react-native-reanimated"] } }
}
Exclusions are often workarounds that may no longer be needed after upgrading. Review each one.
Check if there are any outdated patches in the patches/ directory. Remove them if they are no longer needed.
autoprefixer isn't needed in SDK +53. Remove it from dependencies and check postcss.config.js or postcss.config.mjs to remove it from the plugins list.postcss.config.mjs in SDK +53.Remove redundant metro config options:
experimentalImportSupport is enabled by default in SDK +54.EXPO_USE_FAST_RESOLVER=1 is removed in SDK +54.Since SDK 55, users can opt-in to use Hermes engine v1 for improved runtime performance. This requires setting useHermesV1: true in the expo-build-properties config plugin, and may require a specific version of the hermes-compiler npm package. Hermes v1 will become a default in some future SDK release.
The new architecture is enabled by default, the app.json field "newArchEnabled": true is no longer needed as it's the default. Expo Go only supports the new architecture as of SDK +53.
Weekly Installs
13.9K
Repository
GitHub Stars
1.5K
First Seen
Jan 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode10.5K
github-copilot10.5K
codex10.3K
cursor10.0K
gemini-cli10.0K
amp8.3K
97,600 周安装
expo-app-loading | expo-splash-screen |
| expo-linear-gradient | experimental_backgroundImage + CSS gradients in View |