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

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

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

二、解决方法:

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

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

 

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

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

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

 

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

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

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

 

4、重新打包 npm run build:prod

npm run build:prod

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

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

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://www.net2asp.com/1b701beb01.html