PS F:\work\adapt-portal-web-mobile> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! node_modules/compression-webpack-plugin
npm ERR! dev compression-webpack-plugin@"^10.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack@5.88.2
npm ERR! node_modules/webpack
npm ERR! peer webpack@"^5.1.0" from compression-webpack-plugin@10.0.0
npm ERR! node_modules/compression-webpack-plugin
npm ERR! dev compression-webpack-plugin@"^10.0.0" 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 C:\Users\yjtzf\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\yjtzf\AppData\Local\npm-cache\_logs\2023-10-12T01_21_07_673Z-debug-0.log
解决方法
npm install --legacy-peer-deps
'npm install --legacy-peer-deps'命令允许你安装一个包,即使该包的peer依赖关系没有满足。在npm 7及以上版本中,npm默认行为是对peer依赖进行验证。如果peer依赖没有满足,npm会拒绝安装。而使用'--legacy-peer-deps'标志,可以改变这种行为,即使peer依赖没有满足也可以完成安装。但是,这可能会导致某些功能不工作或者出现其他问题,因此只有在你确定知道你在做什么的情况下才使用这个命令。