Error: Cannot find module ‘html-webpack-plugin‘

凌景辉
2023-12-01
Error: Cannot find module 'html-webpack-plugin'
Require stack:
- E:\rhis-web\ruoyi-ui\node_modules\script-ext-html-webpack-plugin\lib\plugin.js
- E:\rhis-web\ruoyi-ui\node_modules\script-ext-html-webpack-plugin\index.js
- E:\rhis-web\ruoyi-ui\node_modules\webpack-chain\src\Plugin.js
- E:\rhis-web\ruoyi-ui\node_modules\webpack-chain\src\Resolve.js
- E:\rhis-web\ruoyi-ui\node_modules\webpack-chain\src\Config.js
- E:\rhis-web\ruoyi-ui\node_modules\@vue\cli-service\lib\Service.js
- E:\rhis-web\ruoyi-ui\node_modules\@vue\cli-service\bin\vue-cli-service.js
Error: Cannot find module 'html-webpack-plugin'
Require stack:
- E:\rhis-web\ruoyi-ui\node_modules\script-ext-html-webpack-plugin\lib\plugin.js
- E:\rhis-web\ruoyi-ui\node_modules\script-ext-html-webpack-plugin\index.js
- E:\rhis-web\ruoyi-ui\node_modules\webpack-chain\src\Plugin.js
- E:\rhis-web\ruoyi-ui\node_modules\webpack-chain\src\Resolve.js
- E:\rhis-web\ruoyi-ui\node_modules\webpack-chain\src\Config.js
- E:\rhis-web\ruoyi-ui\node_modules\@vue\cli-service\lib\Service.js
- E:\rhis-web\ruoyi-ui\node_modules\@vue\cli-service\bin\vue-cli-service.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ruoyi@3.8.2 build:prod: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ruoyi@3.8.2 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!     E:\NODEJS-V14.17.0\node_cache\_logs\2022-05-27T07_13_57_080Z-debug.log

项目打包的时候出现这个bug,发现是少了 html-webpack-plugin 依赖包,安装上就好了

npm install html-webpack-plugin -D

 类似资料: