我尝试了几次更新SDK版本在我的项目从44到45,46和47。每次我尝试更新我收到以下问题:
安装expo@ ^ 46.0.0✔经过验证的配置。app.json配置无需额外修改
✔将已知软件包更新为兼容版本。移除包锁。删除node_modules。运行npm install失败。请查看npm-error.log了解更多信息。清除打包缓存失败,错误提示:Can't read JSON file:/Users/xxx/xxx/node_modules/expo/package.json├─文件:/Users/xxx/xxx/node_modules/expo/package.json原因:错误:enent:没有这样的文件或目录,打开'/Users/xxx/xxx/node_modules/expo/package.json'已清除打包缓存。✔验证项目
👏自动升级步骤完成。…但这并不意味着一切都完成了!
✅更新了以下包:expo-app-loading, expo-font, expo-status-bar, expo-updates, react, react-dom, react-native, @react-native-async-storage/async-storage, react-native-gesture-handler, react-native-reanimated, react-native-safe-area-context, react-native-screens, react-native-web, react-native-webview, typescript, @babel/core, @types/react, @types/react-native, expo
🚨以下软件包未更新。您应该检查这些存储库的readme,以确定哪个版本与您的新软件包集兼容:@react-native-community/masked-view, @react-navigation/bottom-tabs, @react-navigation/drawer, @react-navigation/native, @react-navigation/stack, accordion- fold -react-native, axios, icommoon_react, localstorage-polyfill, moment, popup-ui, react-flex-router, react-modal, react-native-axios-jwt, react-native-base64, react-native-config, react-native-fetch-api, react-native-flash-message, react-native-modal, react-native-paper,react-native-pop -confirm-toast、react-native-pop -dialog、react-native-status-bar-height、react-native-table-component、react-native-vector-icons、react-tabbordion
请参阅发行说明,了解更新所需的任何进一步步骤和突破性更改的信息:https://blog.expo.dev/expo-sdk-46-c2a1655f63f7
您还应该查看您跳过的版本中的突破性更改:
- https://blog.expo.dev/expo-sdk-45-f4e332954a68
更新后,node_modules文件夹丢失。我做错了什么?
也可以手动删除.expo
,运行expo upgrade