npm报错npm ERR! code ERESOLVE
泛域名ssl证书 239元1年送1个月、单域名39元1年,Sectigo(原Comodo证书)全球可信证书,强大的兼容性,高度安全性,如有问题7天内可退、可开发票
加微信VX 18718058521 备注SSL证书
【腾讯云】2核2G4M云服务器新老同享99元/年,续费同价
npm ERR! code ERESOLVEnpm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: antdesignform@1.0.0npm ERR! Found: webpack@3.12.0npm ERR! node_modules/webpack npm ERR! webpack@"^3.6.0" from the root project npm ERR!npm ERR! Could not resolve dependency:npm ERR! peer webpack@"^4.0.0 || ^5.0.0" from compression-webpack-plugin@5.0.2npm ERR! node_modules/compression-webpack-plugin npm ERR! compression-webpack-plugin@"^5.0.1" 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\Administrator\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\Administrator\AppData\Local\npm-cache\_logs\2023-02-17T01_55_07_216Z-debug-0.log
解决方案:
查看下node和npm的版本
C:\Users\Administrator>node -v v16.14.2C:\Users\Administrator>npm -v 8.5.0
npm的版本过高,高版本的比低版本的严格,所以会报错
3.项目中删除文件
将项目中的node-modules文件夹和package-lock.json文件删除。
重新npm install