将 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
关于node.js - Expo React Native : expected version range: ~6. 0.0 - 实际安装的版本 : ^5. 0.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57274862/