若依Vue分离版打包报错Cannot find module ‘html-webpack-plugin‘

一、错误日志: Cannot find module 'html-webpack-plugin'

 

二、解决方法:

 1、手动的把 node_modules 这个目录删掉

 

  2、重新安装依赖:npm install --registry=https://registry.npm.taobao.org 

npm install --registry=https://registry.npm.taobao.org

 

3、安装缺少的依赖:npm i html-webpack-plugin --save-dev --legacy-peer-deps

npm i html-webpack-plugin --save-dev --legacy-peer-deps

 

4、重新打包 npm run build:prod

npm run build:prod

 

 打包结束,可以部署到服务器啦。

猜你喜欢

转载自blog.csdn.net/weixin_51906670/article/details/130322940