Hello, Install DateTimePicker in my expo project (React native)

Viewed 212

as the title suggests I'm trying to install DateTimePicker and I get this error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@16.13.1
npm ERR! node_modules/react
npm ERR!   react@"16.13.1" from the root project
npm ERR!   peer react@">=16.8.3" from @react-native-community/datetimepicker@3.0.4
npm ERR!   node_modules/@react-native-community/datetimepicker
npm ERR!     @react-native-community/datetimepicker@"3.0.4" from the root project
npm ERR!   1 more (react-native)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from react-native-windows@0.64.5
npm ERR! node_modules/react-native-windows
npm ERR!   peer react-native-windows@">=0.62" from @react-native-community/datetimepicker@3.0.4
npm ERR!   node_modules/@react-native-community/datetimepicker
npm ERR!     @react-native-community/datetimepicker@"3.0.4" 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 C:\Users\robbi\AppData\Local\npm-cache\eresolve-report.txt for a full report.

How can I do?

Sorry for the stupid question but I'm still studying ..

1 Answers

If you are using expo download your dependency through

expo install @react-native-community/datetimepicker

If you have used yarn or npm for that some dependencies might have a conflict with each other (because of incompatibility issues) whereas through expo install it will install the respective version of the package according to your expo version

Related