sudo npm i 装包失败 --ERESOLVE unable to resolve dependency tree


 ~/Desktop/2022/projects/project-web   develop  sudo npm i
Password:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@">=16.9.0" from [email protected]
npm ERR!   node_modules/antd
npm ERR!     dev antd@"4.13.1" from the root project
npm ERR!   peer react@">=15" from [email protected]
npm ERR!   node_modules/mirrorx
npm ERR!     dev mirrorx@"^0.2.13" from the root project
npm ERR!   4 more (react-copy-to-clipboard, react-intl, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from [email protected]
npm ERR! node_modules/@ant-design/icons/node_modules/react-dom
npm ERR!   peer react-dom@">=16.9.0" from [email protected]
npm ERR!   node_modules/@ant-design/icons/node_modules/rc-util
npm ERR!     rc-util@"^5.9.4" from @ant-design/[email protected]
npm ERR!     node_modules/@ant-design/icons
npm ERR!       2 more (antd, antd)
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/.npm/eresolve-report.txt for a full report.


npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/.npm/_logs/2022-02-09T01_54_38_895Z-debug.log
 ✘  ~/Desktop/2022/pr

解决方法:

sudo cnpm i

装包成功!!!

你可能感兴趣的:(sudo npm i 装包失败 --ERESOLVE unable to resolve dependency tree)