错误1:
?INFO ?Building app with electron-builder: ? ? electron-builder ?version=22.14.13 os=10.0.19044 InvalidConfigurationError: "directories" in the root is deprecated, please specify in the "build" ? ? at Object.checkMetadata (G:\work\sbs\flzcRoom\frontend-material-weight-room\node_modules\app-builder-lib\src\util\packageMetadata.ts:78:11) ? ? at Packager.build (G:\work\sbs\flzcRoom\frontend-material-weight-room\node_modules\app-builder-lib\src\packager.ts:335:5) ? ? at Object.executeFinally (G:\work\sbs\flzcRoom\frontend-material-weight-room\node_modules\builder-util\src\promise.ts:12:14) { ? code: 'ERR_ELECTRON_BUILDER_INVALID_CONFIGURATION' }
解决方法:直接删除调package.json文件里面directories
"directories":{
"test": "tests"
}
?错误2:
?
? ? Get "https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.4.1/nsis-resources-3.4.1.7z": read tcp 192.168.1.4:51034->20.205.243.166:443: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ExecError: G:\work\sbs\flzcRoom\frontend-material-weight-room\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE ? ? at Object.onceWrapper (node:events:628:26) ? ? at ChildProcess.emit (node:events:513:28) ? ? at ChildProcess.cp.emit (G:\work\sbs\flzcRoom\frontend-material-weight-room\node_modules\builder-util\node_modules\cross-spawn\lib\enoent.js:34:29) ? ? at maybeClose (node:internal/child_process:1093:16) ? ? at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) { ? exitCode: 1, ? alreadyLogged: false, ? code: 'ERR_ELECTRON_BUILDER_CANNOT_EXECUTE' }
解决方法:
-
全局安装electron-builder npm install -g electron-builder -
electron-builder配置文档地址:electron-builder
|