Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChu
Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead.
解决方法:
我使用淘宝镜像cnpm install安装依赖成功后执行npm run build时报错:
Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead.
我发现在cnpm install 时有警告:requires a peer of webpack@^3.1.0 but webpack@4.41.2 was installed,可以看出webpack版本有問題,就是我項目要求使用webpack@^3.1.0但下载的是webpack@4.41.2
所以我先把所有依赖删除:
rm -rf node_modules
rm -rf package-lock.json
npm cache clear —force
cpm cache clear —force
先执行:http://www.yayihouse.com/yayishuwu/chapter/2294
还没有评论,来说两句吧...