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的時候出現的問題...


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM