【问题标题】:CoreUI: Try to npm install the downloaded free version of CoreUI to try the dashboardCoreUI:尝试 npm install 下载的免费版 CoreUI 来尝试仪表板
【发布时间】:2021-03-21 20:54:47
【问题描述】:

在下载免费的 CoreUI 以进行反应并调用 npm install 后,我收到以下错误。我的印象是错误的依赖是问题,但我不太明白它在说什么。

>  Could not resolve dependency:
npm WARN peer react@"0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0" from enzyme-adapter-utils@1.14.0
npm WARN node_modules/enzyme-adapter-utils
npm WARN   enzyme-adapter-utils@"^1.13.1" from @wojtekmaj/enzyme-adapter-react-17@0.3.2
npm WARN   node_modules/@wojtekmaj/enzyme-adapter-react-17
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   peer react@"^17.0.1" from @coreui/icons-react@1.1.0
npm ERR!   node_modules/@coreui/icons-react
npm ERR!     @coreui/icons-react@"^1.0.2" from the root project
npm ERR!     @coreui/icons-react@"^1.1.0" from @coreui/react@3.4.6
npm ERR!     node_modules/@coreui/react
npm ERR!       @coreui/react@"^3.4.0" from the root project
npm ERR!   8 more (@coreui/react, react-dom, react-router-dom, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^0.14 || ^15.0.0 || ^16.0.0-alpha" from airbnb-prop-types@2.16.0
npm ERR! node_modules/enzyme-adapter-utils/node_modules/airbnb-prop-types
npm ERR!   airbnb-prop-types@"^2.16.0" from enzyme-adapter-utils@1.14.0
npm ERR!   node_modules/enzyme-adapter-utils
npm ERR!     enzyme-adapter-utils@"^1.13.1" from @wojtekmaj/enzyme-adapter-react-17@0.3.2
npm ERR!     node_modules/@wojtekmaj/enzyme-adapter-react-17
npm ERR!       @wojtekmaj/enzyme-adapter-react-17@"^0.3.2" 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  AppData\Local\npm-cache\eresolve-report.txt for a full report.

【问题讨论】:

    标签: reactjs npm dashboard core-ui


    【解决方案1】:

    这是因为 @wojtekmaj/enzyme-adapter-react-17 与 React 17 一起使用,但使用了同样与 React 17 一起使用的酶适配器实用程序,但没有声明 React 17 兼容性。

    好消息是@wojtekmaj/enzyme-adapter-react-17 0.6.0 修复了此问题,因此您只需安装最新版本,错误就会消失。

    如果由于某种原因您无法自行更新适配器,您可以尝试使用--legacy-peer-deps 标志安装您的项目。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-20
      • 1970-01-01
      • 2018-07-22
      • 2022-11-22
      • 2021-03-29
      • 2019-04-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多