@react-native-community/datetimepicker 安装抛出错误

@react-native-community/datetimepicker install throwing error

我尝试为我的 react-native (expo) 项目安装日期时间选择器,但是,当我尝试安装它时;

expo install @react-native-community/picker

它抛出错误;

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.2.0
npm ERR!   node_modules/@react-native-community/datetimepicker
npm ERR!     @react-native-community/datetimepicker@"3.2.0" 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.12
npm ERR! node_modules/react-native-windows
npm ERR!   peer react-native-windows@">=0.62" from @react-native-community/datetimepicker@3.2.0
npm ERR!   node_modules/@react-native-community/datetimepicker
npm ERR!     @react-native-community/datetimepicker@"3.2.0" 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\irfan\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\irfan\AppData\Local\npm-cache\_logs21-06-30T13_38_37_968Z-debug.log

根据这个错误(如果我做对了),这需要不同版本的反应 (17.0.1),安装后可以解决问题,但世博会不支持这个版本的反应。

请提供与 expo 兼容的解决方案。

找了一天,想post放在这里。但是刚刚post我心里就有了答案

为什么不直接从 github 克隆它,而不是使用 exponpm.

安装它

做了同样的事情,现在工作正常。

这个问题也在 github 上提出,但没有解决方案。