Metro has encountered an error: While trying to resolve module '@react-native/normalize-color'
Asked Answered
T

3

5

I just wanted to try react-native.However, after run the script "npm run ios",I got this error in the Xcode's simulator.

enter image description here react-native version: v0.66.0, platform: Mac OS Big Sur 11.6.2, How can I fix this?

Thermionics answered 23/3, 2022 at 3:15 Comment(2)
Please share any relevant code instead of a screenshot by editing your Question. Fewer people are likely to reproduce your issue without having your code in a copyable form.Joppa
Did you use react-native-maps?Meridional
P
13

install '@react-native/normalize-color' using command line npm i @react-native/normalize-color

Polytechnic answered 23/3, 2022 at 6:46 Comment(2)
Sorry,It doesn't work for me.Thermionics
Kevin's answer works if you're using older version of react-native like me.Phantasmagoria
B
10

Try installing '@react-native/[email protected]' if you are using 'react-native-maps'. This worked for me. It's probably because we may be using an older version of 'react-native' which included an older version of 'normalize-color'.

Bedpan answered 8/5, 2022 at 18:57 Comment(2)
This worked. Thank you. I was using react-native 0.66.4Phantasmagoria
Thank you. This worked for me. I encountered this error when I was upgrading my react-native from 0.63.5 to 0.64.0. While @react-native/normalize-color was not in my package.json, @react-native/[email protected] was in my package-lock.json.Whiting
G
0

Nothing worked for me, but these steps.

  • npm i native-base --legacy-peer-deps
  • npm install normalize-css-color
Genethlialogy answered 18/10, 2024 at 7:54 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.