node.js - Expo React Native:预期版本范围:~6.0.0 - 实际安装版本:^5.0.1
问题描述
将 Expo SDK 33 更新到 34 后,我开始注意到几个 expo npm 包必须至少为 v6.0.0 的错误...
$ expo start -c
Starting project at /Users/nyxynyx/expoapp
Expo DevTools is running at http://localhost:19002
Some of your project's dependencies are not compatible with currently installed expo package version:
- expo-ads-admob - expected version range: ~6.0.0 - actual version installed: ^5.0.1
- expo-analytics-amplitude - expected version range: ~6.0.0 - actual version installed: ^5.0.1
- expo-barcode-scanner - expected version range: ~6.0.0 - actual version installed: ^5.0.1
- expo-permissions - expected version range: ~6.0.0 - actual version installed: ^5.0.1
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo install [package-name ...]
...
继续更新这些软件包
$ npm install --save expo-ads-admob expo-analytics-amplitude expo-barcode-scanner expo-permissions
npm WARN The package react-native-dotenv is included as both a dev and production dependency.
+ expo-permissions@5.0.1
+ expo-ads-admob@5.0.1
+ expo-analytics-amplitude@5.0.1
+ expo-barcode-scanner@5.0.1
updated 4 packages and audited 38421 packages in 5.052s
found 11 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
还尝试使用以下方法清除缓存:
rm -rf node_modules
npm cache clean
npm install
watchman watch-del-all
rm -fr $TMPDIR/metro*
expo start -c
但是,存在关于需要 v6.0.0+ 的相同警告消息。该应用程序在 Expo iOS 客户端中运行正常(条形码扫描仪等)。我们应该做什么?
解决方案
如果您正在使用Expo
,我认为这不是安装它的正确方法。如果要从 安装自己的模块Expo
,请使用此命令。
例子
expo install expo-ads-admob
推荐阅读
- vue.js - vue-drag-drop:放置事件目标的上下文
- python - 读取数据文件并从对象中创建列表
- angular - 以角度用 flatMap 完成
- postgresql - PostgreSql jsonb 字段查看
- python - 将时间增量添加到熊猫中的日期列
- javascript - 如何在 angularjs 中不使用 ng-bind 格式化日期?
- reactjs - 如何开玩笑地覆盖反应路由器中使用的匿名函数?
- sass - sass @each 奇怪的行为
- android - 在 Android 中模拟类似 Instagram 的动作效果
- java - 从随机字符串中获取日期模式