![cover](https://img-blog.csdnimg.cn/direct/7fb8847fea234210bcf489606b8c4ea2.png)
【Electron】electron-builder打包过程中报错: A connection attempt failed—connected host has failed to respond
npm run build 打包报错信息如下:Get “https://github.com/electronXXXX”: dial tcp XXXX: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or esta
![](https://csdnimg.cn/release/devpress/public/img/ic-book.4f347164.png)
学习项目使用的是vue3
+typescript
+vite
+electron
,npm run build 打包报错信息如下:
Get “https://github.com/electronXXXX”: dial tcp XXXX: connectex: 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下载一些依赖包,但是由于国内网络种种原因,我们无法正常下载这个些文件,导致下载依赖报错。比如electron-builder打包过程中会涉及到四个包:
- electron-v28.1.4-win32-x64
- winCodeSign-2.6.0
- nsis-3.0.4.1
- nsis-resources-3.4.1
解决方法
上述四个压缩包在GitHub可以直接手动下载https://github.com/electron-userland/electron-builder-binaries/releases
也可以在我上传的文件位置下载https://download.csdn.net/download/weixin_42960907/88778120
下载压缩包之后,放到指定位置:在C:\Users\你的名字\AppData\Local
的electron
和electron-builder
中(需要自己手动解压缩)
如图所示:
1.electron-v28.1.4-win32-x64存放位置
2. winCodeSign-2.6.0存放位置
- nsis-3.0.4.1存放位置(见下图)
- nsis-resources-3.4.1存放位置(见下图)
【视频——Vue3 Vite electron 开发桌面程序】https://www.bilibili.com/video/BV1dS4y1y7vd?p=54&vd_source=46ff36b24b96386dd704c889b6366491
【文章——Vue3 Vite electron 开发桌面程序】https://blog.csdn.net/qq1195566313/article/details/131713875
【electron-builder打包过程中报错——网络下载篇】https://blog.csdn.net/syj573077027/article/details/123610805
更多推荐
所有评论(0)