[1/4] 🤔 Why do we have the module "metro-config"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "[email protected]"
info Has been hoisted to "metro-config"
info Reasons this module exists
- Hoisted from "metro#metro-config"
- Hoisted from "react-native-carousel-swiper#react-native#@react-native-community#cli#metro-config"
info Disk size without dependencies: "1.32MB"
info Disk size with unique dependencies: "13.03MB"
info Disk size with transitive dependencies: "1.32MB"
info Number of shared dependencies: 252
=> Found "@react-native-community/cli#[email protected]"
info Reasons this module exists
- "react-native#@react-native-community#cli" depends on it
- Hoisted from "react-native#@react-native-community#cli#metro#metro-config"
info Disk size without dependencies: "100KB"
info Disk size with unique dependencies: "11.29MB"
info Disk size with transitive dependencies: "100KB"
info Number of shared dependencies: 252
✨ Done in 1.82s.
1条答案
按热度按时间nkoocmlb1#
我在使用react-native 0.63.3时也遇到了类似的问题,但我认为这个建议对其他版本也有帮助。问题的关键是你有一些包用旧版本覆盖了metro-config。在我的情况下,它是react-native-carousel-swiper@^1.0.11包,并且它正在引入metro-config@0.56.4,而react-native应该正在引入一个更新的版本。
您可以在react-native项目的根目录下使用以下命令进行检查:
字符串
你会得到一个类似这样的响应:
型
这样,您就可以了解哪个软件包正在拉入旧版本的metro-config。因此,您可以通过更新过时的软件包来解决问题。