Reputation: 11
I am getting the error below:
npm install react-native-image-picker
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react-native-gesture-handler
npm ERR! peer react-native-gesture-handler@"*" from [email protected]
npm ERR! node_modules/react-native-tab-view
npm ERR! react-native-tab-view@"^2.15.2" from [email protected]
npm ERR! node_modules/react-navigation-tabs
npm ERR! react-navigation-tabs@"^2.11.2" from the root project
npm ERR! peer react-native-gesture-handler@">= 1.5.0" from [email protected]
npm ERR! node_modules/react-navigation-stack
npm ERR! react-navigation-stack@"^2.10.4" from the root project
npm ERR! 1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-gesture-handler@"^1.0.0" from [email protected]
npm ERR! node_modules/react-navigation-tabs
npm ERR! react-navigation-tabs@"^2.11.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react-native-gesture-handler
npm ERR! peer react-native-gesture-handler@"^1.0.0" from [email protected]
npm ERR! node_modules/react-navigation-tabs
npm ERR! react-navigation-tabs@"^2.11.2" from the root project
I tried updating mentioned modules but nothing happened. Still getting the same error.
Upvotes: 1
Views: 357
Reputation: 1
I had the same errror. I fixed it by using yarn instead of npm. Use this command to install it:
yarn add react-native-image-picker
If you don't have already yarn, use this command to install it:
npm install --global yarn
yarn install
yarn add react-native-image-picker
Upvotes: 0
Reputation: 51
It looks like you are using two incompatible libraries. To be more exact, you may be using one that is outdated.
The issue at least lies between these two lines:
npm ERR! Found: [email protected]
and
npm ERR! peer react-native-gesture-handler@"^1.0.0" from [email protected]
Having react-native-gesture-handler@"^1.0.0
in a dependency means that the dependency resolution should only accept versions 1.x.x
and not 2.x.x
of the library.
Considering what your problem is right now, you may want to just remove in your package.json
file the specific reference to react-native-gesture-handler
, because my guess is that you installed it manually and it got resolved to the latest version.
However, if you want to make your solution future-proof, you may want to look on the internet for the right libraries. If you look on the official page of the react-navigation-tabs
library here, you will find that this library is not supported anymore, you have to use @react-navigation/bottom-tabs
now.
I strongly advise you do that for all your libraries before really digging into the project, because refactoring can be a huge hassle if done too late, since updates will probably involve stability and compatibility improvements, if not even security fixes.
I hope this will help.
Upvotes: 1