npm ERR! code ERESOLVEnpm ERR! ERESOLVE could not resolvenpm ERR!-解决

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: [email protected]
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^5.1.0" from [email protected]
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 ERR! code ERESOLVEnpm ERR! ERESOLVE could not resolvenpm ERR!-解决_第1张图片

解决方法 

npm install --legacy-peer-deps

'npm install --legacy-peer-deps'命令允许你安装一个包,即使该包的peer依赖关系没有满足。在npm 7及以上版本中,npm默认行为是对peer依赖进行验证。如果peer依赖没有满足,npm会拒绝安装。而使用'--legacy-peer-deps'标志,可以改变这种行为,即使peer依赖没有满足也可以完成安装。但是,这可能会导致某些功能不工作或者出现其他问题,因此只有在你确定知道你在做什么的情况下才使用这个命令。

npm ERR! code ERESOLVEnpm ERR! ERESOLVE could not resolvenpm ERR!-解决_第2张图片

你可能感兴趣的:(工具,前端,npm,前端,node.js)