我试图为我的react-native (expo)项目安装datetime picker,但是,当我试图安装它时;
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\_logs\2021-06-30T13_38_37_968Z-debug.log根据这个错误(如果我没弄错),这需要一个不同版本的react (17.0.1),它在安装时解决了这个问题,但是expo不支持这个版本的react。
请提供与世博会兼容的解决方案。
发布于 2021-06-30 22:11:37
找了一整天后,我想把它贴在这里。但就在发帖后,我在脑海中得到了一个答案。
为什么不直接从github克隆它,而不是用expo或npm安装它。
做了同样的事情,现在工作得很好。
这个问题也在github上提出,但它没有解决方案。
https://stackoverflow.com/questions/68195984
复制相似问题