小丶丶
2022-04-08 00:45
浏览 89
已结题

webpack 打包报错" Failed to load 'F:\VSCode\work\webpack\04.打包html资源\webpack.config.js' config,如何解决?

PS F:\VSCode\work\webpack\04.打包html资源> webpack
[webpack-cli] Failed to load 'F:\VSCode\work\webpack\04.打包html资源\webpack.config.js' config
[webpack-cli] Error: Cannot find module 'html-webpack-plugin'
Require stack:

  • F:\VSCode\work\webpack\04.打包html资源\webpack.config.js
  • F:\VSCode\work\webpack\node_modules\webpack-cli\lib\webpack-cli.js
  • F:\VSCode\work\webpack\node_modules\webpack-cli\lib\bootstrap.js
  • F:\VSCode\work\webpack\node_modules\webpack-cli\bin\cli.js
  • C:\Users\a\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\import-local\index.js
  • C:\Users\a\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js
  • C:\Users\a\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object. (F:\VSCode\work\webpack\04.打包html资源\webpack.config.js:6:27)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'F:\VSCode\work\webpack\04.打包html资源\webpack.config.js',
    'F:\VSCode\work\webpack\node_modules\webpack-cli\lib\webpack-cli.js',
    'F:\VSCode\work\webpack\node_modules\webpack-cli\lib\bootstrap.js',
    'F:\VSCode\work\webpack\node_modules\webpack-cli\bin\cli.js',
    'C:\Users\a\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\import-local\index.js',
    'C:\Users\a\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js',
    'C:\Users\a\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js'
    ]
    }

莫名奇妙出错,跟着b站的视频一步步做的

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题