npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: antdesignform@1.0.0
npm ERR! Found: webpack@3.12.0
npm 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.2
npm 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.2
C:\Users\Administrator>npm -v
8.5.0
npm的版本过高,高版本的比低版本的严格,所以会报错
C:\Users\Administrator>npm install npm@6.14.10 -g
3.项目中删除文件
将项目中的node-modules文件夹和package-lock.json文件删除。
重新npm install