react-native-picker / picker

Picker is a cross-platform UI component for selecting an item from a list of options.
MIT License
1.49k stars 280 forks source link

Incompatible with react-native@0.69 #425

Closed stocaaro closed 1 year ago

stocaaro commented 2 years ago

When starting a new react-native project with picker using npm version >= 7, the npm install process fails.

Reproduction steps:

export PROJECTNAME=projectname
npx react-native@latest init $PROJECTNAME
cd $PROJECTNAME
npm install @react-native-picker/picker

Result:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: projectname@0.0.1
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   react@"18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16 || 17" from @react-native-picker/picker@2.4.2
npm ERR! node_modules/@react-native-picker/picker
npm ERR!   @react-native-picker/picker@"*" 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.
...

Workarounds:

stocaaro commented 1 year ago

I think this has been resolved with the above merged fix.

nora-soderlund commented 1 year ago

It has not. Using latest version (2.4.8) on expo 46.0.9, react 18.0.0, react native 0.69.6 gives this:

Some dependencies are incompatible with the installed expo version: @react-native-picker/picker@2.4.8 - expected version: 2.4.2 Your project may not work correctly until you install the correct versions of the packages. Install individual packages by running npx expo install @react-native-picker/picker@2.4.2

Attempting to downgrade gives this: npm install @react-native-picker/picker@2.4.2 npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: ridetracker@1.0.0 npm ERR! Found: react@18.0.0 npm ERR! node_modules/react npm ERR! react@"18.0.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"16 || 17" from @react-native-picker/picker@2.4.2 npm ERR! node_modules/@react-native-picker/picker npm ERR! @react-native-picker/picker@"2.4.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.

alexvazquez commented 1 year ago

I have the same problem.

I using NodeJS 18.15.0 and when running npm install I'm getting:

npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: react-test-renderer@17.0.2 npm ERR! Found: react@18.2.0 npm ERR! node_modules/react npm ERR! react@"18.2.0" from the root project npm ERR! peer react@">=16" from @react-native-picker/picker@2.4.8 npm ERR! node_modules/@react-native-picker/picker npm ERR! @react-native-picker/picker@"^2.4.8" from the root project npm ERR! 28 more (@react-navigation/bottom-tabs, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"17.0.2" from react-test-renderer@17.0.2 npm ERR! node_modules/react-test-renderer npm ERR! dev react-test-renderer@"^17.0.2" from the root project npm ERR! peer react-test-renderer@">=16.8.0" from @testing-library/react-native@12.0.1 npm ERR! node_modules/@testing-library/react-native npm ERR! @testing-library/react-native@"^12.0.1" from the root project npm ERR! npm ERR! Conflicting peer dependency: react@17.0.2 npm ERR! node_modules/react npm ERR! peer react@"17.0.2" from react-test-renderer@17.0.2 npm ERR! node_modules/react-test-renderer npm ERR! dev react-test-renderer@"^17.0.2" from the root project npm ERR! peer react-test-renderer@">=16.8.0" from @testing-library/react-native@12.0.1 npm ERR! node_modules/@testing-library/react-native npm ERR! @testing-library/react-native@"^12.0.1" 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.

alexvazquez commented 1 year ago

It has not. Using latest version (2.4.8) on expo 46.0.9, react 18.0.0, react native 0.69.6 gives this:

Some dependencies are incompatible with the installed expo version: @react-native-picker/picker@2.4.8 - expected version: 2.4.2 Your project may not work correctly until you install the correct versions of the packages. Install individual packages by running npx expo install @react-native-picker/picker@2.4.2

Attempting to downgrade gives this: npm install @react-native-picker/picker@2.4.2 npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: ridetracker@1.0.0 npm ERR! Found: react@18.0.0 npm ERR! node_modules/react npm ERR! react@"18.0.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"16 || 17" from @react-native-picker/picker@2.4.2 npm ERR! node_modules/@react-native-picker/picker npm ERR! @react-native-picker/picker@"2.4.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.

Did you find a way to solve this?