webpack安装html-wepack-plugin时报错

98 阅读1分钟

e4b0877c7c85cd08c93c9bb336b495f.png 是因为在安装webpack时的版本不是最新版本,安装html-wepack-plugin没有指定版本,默认安装了最新版本,导致相互不兼容。

  • 删除最新版本的html-wepack-plugin yarn remove html-webpack-plugin --dev
  • 下载和webpack向邻近的版本 yarn add html-webpack-plugin@4.0.0 --dev