【问题标题】:Expo and Native Base unable to resolve dependency treeExpo 和 Native Base 无法解析依赖树
【发布时间】:2021-05-23 12:30:09
【问题描述】:

新安装 expo init firstapp 然后下一个 npm install native-base。我在下面遇到这样的错误。我尝试删除 node_modules 并尝试删除 expo cli 我没有成功。

有人遇到过吗?

PS E:\Projects\ReactNative\firstapp> npm install native-base
>>
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@16.13.1
npm ERR! node_modules/react
npm ERR!   peer react@"^16.13.1" from react-dom@16.13.1
npm ERR!   node_modules/react-dom
npm ERR!     peer react-dom@">=16.5.1" from react-native-web@0.13.18
npm ERR!     node_modules/react-native-web
npm ERR!       react-native-web@"~0.13.12" from the root project
npm ERR!     react-dom@"16.13.1" from the root project
npm ERR!   peer react@"*" from react-native-safe-area-context@3.2.0
npm ERR!   node_modules/react-native-safe-area-context
npm ERR!     react-native-safe-area-context@"3.2.0" from expo@41.0.1
npm ERR!     node_modules/expo
npm ERR!       expo@"~41.0.1" from the root project
npm ERR!   5 more (react-native-web, use-subscription, the root project, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from react-native-windows@0.64.8
npm ERR! node_modules/native-base/node_modules/react-native-windows
npm ERR!   peer react-native-windows@">=0.62" from @react-native-community/datetimepicker@3.5.0
npm ERR!   node_modules/native-base/node_modules/@react-native-community/datetimepicker
npm ERR!     @react-native-community/datetimepicker@"^3.0.2" from native-base@2.15.2
npm ERR!     node_modules/native-base
npm ERR!       native-base@"*" 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\XXX\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\XXX\AppData\Local\npm-cache\_logs\2021-05-23T08_04_02_291Z-debug.log

【问题讨论】:

  • 你使用的是哪个版本的 react ?

标签: react-native native-base


【解决方案1】:

看起来您的问题的解决方案可能是使用与您的 react native 版本兼容的原生 base 版本,请参阅 Compatibility Versions 部分中native base documentation 中的表格。

【讨论】:

    猜你喜欢
    • 2021-07-12
    • 2021-08-08
    • 2021-08-04
    • 2021-02-19
    • 2023-02-09
    • 2021-05-12
    • 1970-01-01
    • 2022-07-27
    • 2021-09-25
    相关资源
    最近更新 更多