【打包报错】ERROR Error: Cannot find module ‘html-webpack-plugin‘

问题

项目之前打包好好的,今天拉取仓库代码下来后重新打包,发现报错了,控制条打印ERROR Error: Cannot find module ‘html-webpack-plugin’

解决方案

找不到html-webpack-plugin这个依赖插件,我们就安装这个依赖插件,然后再重新打包,咦,这样就解决了,打包成功;

  • 1、安装
npm install html-webpack-plugin -D
  • 2、重新打包就可以了

在这里插入图片描述

> mengzhu-operation@4.7.0 build:prod E:\MengZhuKeJiWork\projects\mengzhu-operation
> vue-cli-service build


✔  Building for production...
 ERROR  Error: Cannot find module 'html-webpack-plugin'
Require stack:
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\script-ext-html-webpack-plugin\lib\plugin.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\script-ext-html-webpack-plugin\index.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\webpack-chain\src\Plugin.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\webpack-chain\src\Resolve.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\webpack-chain\src\Config.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\@vue\cli-service\lib\Service.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\@vue\cli-service\bin\vue-cli-service.js
Error: Cannot find module 'html-webpack-plugin'
Require stack:
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\script-ext-html-webpack-plugin\lib\plugin.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\script-ext-html-webpack-plugin\index.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\webpack-chain\src\Plugin.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\webpack-chain\src\Resolve.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\webpack-chain\src\Config.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\@vue\cli-service\lib\Service.js
- E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\@vue\cli-service\bin\vue-cli-service.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15)
    at Function.Module._load (internal/modules/cjs/loader.js:774:27)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at require (internal/modules/cjs/helpers.js:107:18)
    at Object.<anonymous> (E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\script-ext-html-webpack-plugin\lib\plugin.js:3:27)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at require (internal/modules/cjs/helpers.js:107:18)
    at Object.<anonymous> (E:\MengZhuKeJiWork\projects\mengzhu-operation\node_modules\script-ext-html-webpack-plugin\index.js:3:36)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mengzhu-operation@4.7.0 build:prod: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mengzhu-operation@4.7.0 build:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\appInstall\nodejs-v14\node_cache\_logs\2023-12-16T06_41_58_046Z-debug.log
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

菜又爱编程

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值