【问题标题】:getting an error when using `npm install react-native-modal-datetime-picker` in terminal在终端中使用“npm install react-native-modal-datetime-picker”时出错
【发布时间】:2021-04-01 11:13:49
【问题描述】:

我正在开发一个应用程序,每当我尝试安装 react-native-modal-datetime-picker 包时,它总是抛出一个错误,这对于任何日期时间选择器包都是一样的,例如 @react-native-community/datetime-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.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.2
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 /Users/accountName/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/accountName/.npm/_logs/2jajaijajaijajajajjajajajjjaijajajjajjjjjjjjjjjjjjajjjajaijjjjjjj

如果您对如何解决此问题有任何想法,请告诉我...提前致谢!

【问题讨论】:

    标签: javascript node.js react-native npm


    【解决方案1】:

    此问题尚未完全解决,但如果您遇到此问题,请尝试使用 yarn 安装包

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-06
      • 2021-02-05
      • 2020-12-02
      • 1970-01-01
      • 2016-01-19
      • 1970-01-01
      • 1970-01-01
      • 2022-01-20
      相关资源
      最近更新 更多