I’m working with a MacBook Pro M2 on an React Native app project and I’m having ‘ERESOLVE overriding peer dependency’ error that is preventing me to run the app. I’m hours and hours trying several different stuff, but still stuck in this error. Anyone able to help me? Follow bellow the error:
dudibarros@Eduardos-MBP BrinkaKids % npm install npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: @callstack/[email protected] npm WARN Found: [email protected] npm WARN node_modules/react npm WARN react@"^18.0.0" from the root project npm WARN 30 more (@react-native-community/clipboard, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^16.3.0" from @callstack/[email protected] npm WARN node_modules/@callstack/react-theme-provider npm WARN @callstack/react-theme-provider@"3.0.3" from [email protected] npm WARN node_modules/react-native-country-picker-modal npm WARN npm WARN Conflicting peer dependency: [email protected] npm WARN node_modules/react npm WARN peer react@"^16.3.0" from @callstack/[email protected] npm WARN node_modules/@callstack/react-theme-provider npm WARN @callstack/react-theme-provider@"3.0.3" from [email protected] npm WARN node_modules/react-native-country-picker-modal npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @react-native-community/[email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! react@"^18.0.0" from the root project npm ERR! peer react@">=16.0" from @react-native-community/[email protected] npm ERR! node_modules/@react-native-community/clipboard npm ERR! @react-native-community/clipboard@"^1.5.1" from the root project npm ERR! 29 more (@react-native-community/push-notification-ios, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^16.8" from @react-native-community/[email protected] npm ERR! node_modules/@react-native-community/async-storage npm ERR! @react-native-community/async-storage@"^1.6.2" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/react npm ERR! peer react@"^16.8" from @react-native-community/[email protected] npm ERR! node_modules/@react-native-community/async-storage npm ERR! @react-native-community/async-storage@"^1.6.2" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! /Users/dudibarros/.npm/_logs/2023-11-27T00_38_26_075Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /Users/dudibarros/.npm/_logs/2023-11-27T00_38_26_075Z-debug-0.log dudibarros@Eduardos-MBP BrinkaKids % npm install --legacy-peer-deps
[email protected] postinstall patch-package
patch-package 6.5.1 Applying patches...
ERROR Failed to apply patch for package react-native at path
node_modules/react-native
This error was caused because react-native has changed since you made the patch file for it. This introduced conflicts with your patch, just like a merge conflict in Git when separate incompatible changes are made to the same piece of code.
Maybe this means your patch file is no longer necessary, in which case hooray! Just delete it!
Otherwise, you need to generate a new patch file.
To generate a new one, just repeat the steps you made to generate the first one.
i.e. manually make the appropriate file changes, then run
patch-package react-native
Info: Patch file: patches/react-native+0.71.3.patch Patch was made for version: 0.71.3 Installed version: 0.72.7
patch-package finished with 1 error(s).
up to date, audited 1764 packages in 6s
133 packages are looking for funding
run npm fund
for details
18 vulnerabilities (5 moderate, 6 high, 7 critical)
To address issues that do not require attention, run: npm audit fix
To address all issues (including breaking changes), run: npm audit fix --force
Run npm audit
for details.
I tried clean and reinstall dependencies several times and in several different ways.
I'm expecting to run the project in my computer in both iOS and Android simulators.