electron 打包报错

 

building target=nsis file=dist_electron\MyCodeGenerator Setup 0.1.0.exe archs=x64 oneClick=false perMachine=false ⨯ 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.7:53538->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. github.com/develar/app-builder/pkg/download.(*Downloader).follow.func1 /Volumes/data/Documents/app-builder/pkg/download/downloader.go:206 github.com/develar/app-builder/pkg/download.(*Downloader).follow /Volumes/data/Documents/app-builder/pkg/download/downloader.go:234 github.com/develar/app-builder/pkg/download.(*Downloader).DownloadNoRetry /Volumes/data/Documents/app-builder/pkg/download/downloader.go:128 github.com/develar/app-builder/pkg/download.(*Downloader).Download /Volumes/data/Documents/app-builder/pkg/download/downloader.go:112 github.com/develar/app-builder/pkg/download.DownloadArtifact /Volumes/data/Documents/app-builder/pkg/download/artifactDownloader.go:107 github.com/develar/app-builder/pkg/download.ConfigureArtifactCommand.func1 /Volumes/data/Documents/app-builder/pkg/download/artifactDownloader.go:27 github.com/alecthomas/kingpin.(*actionMixin).applyActions /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/actions.go:28 github.com/alecthomas/kingpin.(*Application).applyActions /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:557 github.com/alecthomas/kingpin.(*Application).execute /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:390 github.com/alecthomas/kingpin.(*Application).Parse /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:222 main.main /Volumes/data/Documents/app-builder/main.go:90 runtime.main /usr/local/Cellar/go/1.16.5/libexec/src/runtime/proc.go:225 runtime.goexit /usr/local/Cellar/go/1.16.5/libexec/src/runtime/asm_amd64.s:1371
ExecError: D:\WorkGitHub\mycodegenerator\src\mycodegenerator\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE at ChildProcess.<anonymous> (D:\WorkGitHub\mycodegenerator\src\mycodegenerator\node_modules\builder-util\src\util.ts:250:14) at Object.onceWrapper (node:events:628:26) at ChildProcess.emit (node:events:513:28) at ChildProcess.cp.emit (D:\WorkGitHub\mycodegenerator\src\mycodegenerator\node_modules\builder-util\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1100:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) { exitCode: 1, alreadyLogged: false, code: 'ERR_ELECTRON_BUILDER_CANNOT_EXECUTE'

处理方法:

1、试试地址是否能访问,不能改仓库地址或FQ

2、启用 electron-builder 的调试模式,查看更详细的日志信息

set DEBUG=electron-builder

npm run electron:build

 

posted @ 2025-04-26 12:35  三瑞  阅读(202)  评论(0)    收藏  举报