React native npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR?

Viewed 324

npm install not working I am facing this error logs

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR!

 npm ERR! While resolving:xxx@0.0.1
    npm ERR! Found: react@17.0.2
    npm ERR! node_modules/react
    npm ERR! react@"17.0.2" from the root project
    npm ERR! peer react@"*" from react-native-country-picker-modal@2.0.0
    npm ERR! node_modules/react-native-country-picker-modal
    npm ERR! react-native-country-picker-modal@"^2.0.0" from the root project
    npm ERR! 
    npm ERR! Could not resolve dependency:
    npm ERR! peer react@"^18.2.0" from react-dom@18.2.0
    npm ERR! node_modules/react-dom
    npm ERR! peer react-dom@"*" from react-native-country-picker-modal@2.0.0
1 Answers

Resolved this error by using

npm install --force 
npm install --legacy-peer-deps

or

we can use yarn install in some cases yarn works

Related