Metro 遇到错误:尝试解析模块“@react-native/normalize-color”时

问题描述 投票:0回答:3

我只是想尝试一下react-native。但是,运行脚本“npm run ios”后,我在Xcode的模拟器中收到此错误。

enter image description here 反应本机版本:v0.66.0, 平台:Mac OS Big Sur 11.6.2, 我该如何解决这个问题?

xcode react-native
3个回答
12
投票

使用命令行安装“@react-native/normalize-color”

npm i @react-native/normalize-color


10
投票

如果您使用“react-native-maps”,请尝试安装“@react-native/[email protected]”。这对我有用。这可能是因为我们可能使用旧版本的“react-native”,其中包括旧版本的“normalize-color”。


0
投票

没有什么对我有用, 但这些步骤。

  • npm 我本机基础 --legacy-peer-deps
  • npm 安装normalize-css-color
© www.soinside.com 2019 - 2024. All rights reserved.