用electron-webpack启动项目出错

来源:1-1 学习本课程的收获以及案例展示(内附彩蛋)

慕慕1545788

2021-01-08

用electron-webpack启动项目出错:
warning “electron-webpack > mini-css-extract-plugin@0.9.0” has incorrect peer dependency “webpack@^4.4.0”.
warning “electron-webpack > webpack-cli@3.3.12” has incorrect peer dependency “webpack@4.x.x”.
warning " > electron-webpack@2.8.2" has incorrect peer dependency “webpack@^4.42.1”.
[4/4] Building fresh packages…
success Saved 1 new dependency.
info Direct dependencies
└─ electron-webpack@2.8.2
info All dependencies
└─ electron-webpack@2.8.2
Done in 6.43s.

D:\Software\electron_projects\demo_yarn2.1\demo_yarn>yarn start
yarn run v1.22.10
$ electron-webpack dev
┏ Renderer -------------------

AttachConsole failed with error 6: �������

┗ ----------------------------
ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.

  • configuration.optimization has an unknown property ‘namedModules’. These properties are valid:
    object { checkWasmTypes?, chunkIds?, concatenateModules?, emitOnErrors?, flagIncludedChunks?, innerGraph?, mangleExports?, mangleWasmImports?, mergeDuplicateChunks?, minimize?, minimizer?, moduleIds?, noEmitOnErrors?, nodeEnv?, portableRecords?, providedExports?, realContentHash?, removeAvailableModules?, removeEmptyChunks?, runtimeChunk?, sideEffects?, splitChunks?, usedExports? }
    -> Enables/Disables integrated optimizations.
    Did you mean optimization.moduleIds: “named” (BREAKING CHANGE since webpack 5)?
    这个是webpack版本不匹配造成的么,该如何解决呢?
写回答

1回答

张轩

2021-01-08

同学你好 你使用的这个 electron-webpack 项目的 github 地址是什么 发我一下 我看看

0
2
张轩
回复
慕慕1545788
把你现在的这个简单项目发给我吧 我在本地给你试试看
2021-01-09
共2条回复

2024更新 Electron+React+七牛云实战跨平台桌面应用

开发一款自动云同步的 Markdown 文件管理软件

1251 学习 · 463 问题

查看课程