npm install出现的错误

npm install出现的错误

在项目的目录执行npm install的时候出现:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: ant-design-pro@4.5.0
npm ERR! Found: react@16.14.0
npm ERR! node_modules/react
npm ERR!   react@"^16.14.0" from the root project
npm ERR!   peer react@">=16.9.0" from @ant-design/pro-descriptions@1.7.5
npm ERR!   node_modules/@ant-design/pro-descriptions
npm ERR!     @ant-design/pro-descriptions@"^1.2.0" from the root project
npm ERR!   1 more (antd)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from react-dom@17.0.2
npm ERR! node_modules/react-dom
npm ERR!   react-dom@"^17.0.0" from the root project
npm ERR!   peer react-dom@">=16.9.0" from antd@4.15.3
npm ERR!   node_modules/antd
npm ERR!     antd@"^4.15.0" from the root project
npm ERR!     1 more (@ant-design/pro-descriptions)
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/darry/.npm/eresolve-report.txt for a full report.

解决方案:

npm i --legacy-peer-deps

然后执行npm install 问题解决..
这是在使用ant-designed-pro 4的时候出现的问题...

posted @   _海阔天空  阅读(1553)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
历史上的今天:
2020-04-08 电导率与土壤盐浓度间的计算公式
点击右上角即可分享
微信分享提示