npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: webpack@5.36.2
npm ERR! node_modules/webpack
npm ERR! peer webpack@"^4.0.0 || ^5.0.0" from webpack-dev-middleware@3.7.3
npm ERR! node_modules/webpack-dev-middleware
npm ERR! webpack-dev-middleware@"^3.7.2" from webpack-dev-server@3.11.2
npm ERR! node_modules/webpack-dev-server
npm ERR! peer webpack@"^4.0.0 || ^5.0.0" from webpack-dev-server@3.11.2
npm ERR! node_modules/webpack-dev-server
npm ERR! 2 more (html-webpack-plugin, terser-webpack-plugin)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@“4.x.x” from webpack-cli@3.3.12
npm ERR! node_modules/webpack-cli
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\18737\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\18737\AppData\Local\npm-cache_logs\2021-05-06T08_43_04_446Z-debug.lognpm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! Found:-小白菜博客
遇到这个问题就把npm指定到版本 npx -p npm@6 npm i --legacy-peer-deps
因为ERESOLVE与npm@7有关的问题很常见,因为npm7.x对某些事情比你怕6.x更严格。最简单的解决方案是将–legacy-peer-deps标志传递给npm 或者使用npm@6