Home > OS >  ERESOLVE unable to resolve dependency tree while installing Font Awesome
ERESOLVE unable to resolve dependency tree while installing Font Awesome

Time:08-22

I am workin on a react native project and I tried installing Font Awesome "npm i --save @fortawesome/react-native-fontawesome @fortawesome/fontawesome-svg-core react-native-svg" using but I got

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"18.0.0" from [email protected]
npm ERR! node_modules/react-native
npm ERR!   react-native@"0.69.4" from the root project
npm ERR!   peer react-native@">= 0.67" from @fortawesome/[email protected]
npm ERR!   node_modules/@fortawesome/react-native-fontawesome
npm ERR!     @fortawesome/react-native-fontawesome@"*" 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! See /Users/itaylador/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/itaylador/.npm/_logs/2022-08-15T22_50_28_934Z-debug-0.log

How can I solve this error?

CodePudding user response:

I had the same issue recently. Tried a lot configurations but the only thing that worked for me was downgrade from [email protected] to [email protected] in the package.json

Some other guys here on stackoverflow gave the hint (if you have peer dependency conflicts) to open (on MacOS) /Users/YourUser/.npm folder and delete the folders _cacache, _logs, _npx

You can also try to delete node_modules folder and package-lock.json file at the end and re-install via "npm install"

  • Related