webpack5版本下安装webpack-dev-server报错
我看官网webpack5版本demo例子都有用webpack-dev-server
请问下下面报错是不支持webpack5版本的意思么
macMacBook-Pro:webpack-demo-02 mac$ npm install --save-dev webpack-dev-server
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: webpack@5.10.0
npm ERR! node_modules/webpack
npm ERR! peer webpack@"*" from clean-webpack-plugin@3.0.0
npm ERR! node_modules/clean-webpack-plugin
npm ERR! dev clean-webpack-plugin@"^3.0.0" from the root project
npm ERR! peer webpack@"^4.27.0 || ^5.0.0" from css-loader@5.0.1
npm ERR! node_modules/css-loader
npm ERR! dev css-loader@"^5.0.1" from the root project
npm ERR! 7 more (file-loader, html-webpack-plugin, style-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.0.0" from webpack-dev-middleware@3.7.2
npm ERR! node_modules/webpack-dev-server/node_modules/webpack-dev-middleware
npm ERR! webpack-dev-middleware@"^3.7.2" from webpack-dev-server@3.11.0
npm ERR! node_modules/webpack-dev-server
npm ERR! dev webpack-dev-server@"*" 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 /Users/mac/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mac/.npm/_logs/2020-12-11T05_33_45_905Z-debug.log
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
果然是webpack版本太高的原因,把webpack降到4.27.0版本就可以正常安装webpack-dev-server了