正如标题所示,我正在尝试安装DateTimePicker,并收到以下错误:
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.我该怎么做呢?
很抱歉问这个愚蠢的问题,但我还在学习..
发布于 2021-05-03 18:06:27
如果您正在使用expo,请通过
expo install @react-native-community/datetimepicker如果您使用过yarn或npm,则某些依赖项可能会相互冲突(由于不兼容问题),而通过expo安装,它将根据您的expo版本安装相应版本的软件包。
https://stackoverflow.com/questions/67322279
复制相似问题