TypeError: Cannot read property 'make' of undefined;html-webpack-plugin\lib\cached-child-compiler.js
PS F:\vue\vue20200414\param8> npm run dev> param8@1.0.0 dev F:\vue\vue20200414\param8> webpack --config ./webpack.dev.config.jsF:\vue\vue20200414\param8\node_modules\webpack\bin\webpack...
·
PS F:\vue\vue20200414\param8> npm run dev
> param8@1.0.0 dev F:\vue\vue20200414\param8
> webpack --config ./webpack.dev.config.js
F:\vue\vue20200414\param8\node_modules\webpack\bin\webpack.js:348
throw err;
^
TypeError: Cannot read property 'make' of undefined
at PersistentChildCompilerSingletonPlugin.apply (F:\vue\vue20200414\param8\node_modules\html-webpack-plugin\lib\cached-child-compiler.js:182:20)
at new CachedChildCompilation (F:\vue\vue20200414\param8\node_modules\html-webpack-plugin\lib\cached-child-compiler.js:68:44)
at HtmlWebpackPlugin.apply (F:\vue\vue20200414\param8\node_modules\html-webpack-plugin\index.js:92:33)
at Compiler.apply (F:\vue\vue20200414\param8\node_modules\tapable\lib\Tapable.js:375:16)
at webpack (F:\vue\vue20200414\param8\node_modules\webpack\lib\webpack.js:33:19)
at processOptions (F:\vue\vue20200414\param8\node_modules\webpack\bin\webpack.js:335:15)
at F:\vue\vue20200414\param8\node_modules\webpack\bin\webpack.js:397:2
at Object.Yargs.self.parse (F:\vue\vue20200414\param8\node_modules\yargs\yargs.js:533:18)
at Object.<anonymous> (F:\vue\vue20200414\param8\node_modules\webpack\bin\webpack.js:152:7)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
at internal/main/run_main_module.js:17:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! param8@1.0.0 dev: `webpack --config ./webpack.dev.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the param8@1.0.0 dev 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! C:\Program Files\nodejs\node_cache\_logs\2020-04-19T10_45_23_037Z-debug.log
PS F:\vue\vue20200414\param8> npm uninstall html-webpack-plugin
npm WARN css-loader@3.5.2 requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN file-loader@6.0.0 requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN style-loader@1.1.4 requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN url-loader@4.1.0 requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN param8@1.0.0 No description
npm WARN param8@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
removed 67 packages and audited 3454 packages in 4.126s
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
方法将"html-webpack-plugin"版本由 "^4.2.0"改为 "^3.2.0",
npm uninstall html-webpack-plugin
npm install html-webpack-plugin@3.2.0 -D
原因尚不清楚
下面这个一样道理,感觉出现这种bug,就是版本问题
PS F:\vue\vue20200414\param9> npm run dev
> param8@1.0.0 dev F:\vue\vue20200414\param9
> webpack-dev-server --open --hot --inline --config ./webpack.dev.config.js
The CLI moved into a separate package: webpack-cli
Please install 'webpack-cli' in addition to webpack itself to use the CLI
-> When using npm: npm i -D webpack-cli
-> When using yarn: yarn add -D webpack-cli
internal/modules/cjs/loader.js:775
throw err;
^
Error: Cannot find module 'webpack-cli/bin/config-yargs'
Require stack:
- F:\vue\vue20200414\param9\node_modules\webpack-dev-server\bin\webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
at Function.Module._load (internal/modules/cjs/loader.js:677:27)
at Module.require (internal/modules/cjs/loader.js:830:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object.<anonymous> (F:\vue\vue20200414\param9\node_modules\webpack-dev-server\bin\webpack-dev-server.js:65:1)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'F:\\vue\\vue20200414\\param9\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! param8@1.0.0 dev: `webpack-dev-server --open --hot --inline --config ./webpack.dev.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the param8@1.0.0 dev 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! C:\Program Files\nodejs\node_cache\_logs\2020-04-19T13_52_00_593Z-debug.log
更多推荐
已为社区贡献11条内容
所有评论(0)