当前位置: 首页 > news >正文

electron-builder打包时github包下载失败【解决办法】

各位朋友们,在使用electron开发时,选择了electron-builder作为编译打包工具时,是否经常遇到无法从github上下载依赖包问题,如下报错:

Get "https://github.com/electron/electron/releases/download/v6.1.12/electron-v6.1.12-win32-ia32.zip": dial tcp 20.205.243.166:443: 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.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/electron.(*ElectronDownloader).doDownload/Volumes/data/Documents/app-builder/pkg/electron/electronDownloader.go:192
github.com/develar/app-builder/pkg/electron.(*ElectronDownloader).Download/Volumes/data/Documents/app-builder/pkg/electron/electronDownloader.go:177
github.com/develar/app-builder/pkg/electron.downloadElectron.func1.1/Volumes/data/Documents/app-builder/pkg/electron/electronDownloader.go:73
github.com/develar/app-builder/pkg/util.MapAsyncConcurrency.func2/Volumes/data/Documents/app-builder/pkg/util/async.go:68

报错截图:

原因就是github被墙,无法访问导致。

那么,解决办法也很简单:

1、找到可替代github的镜像,从这里手动下载对应zip包,推荐一个:https://github.xzc888.top

把github域名替换为上述镜像域名,如图:

https://github.com/electron/electron/releases/download/v6.1.12/electron-v6.1.12-win32-ia32.zip
替换为:
https://github.xzc888.top/electron/electron/releases/download/v6.1.12/electron-v6.1.12-win32-ia32.zip

然后访问,完成下载,如图:

2、下载到zip包后,放到对应目录下:C:\Users\{username}\AppData\Local\electron\Cache

把下载后的zip包拷贝到目上述目录下,如图:

3、再次运行打包即可

备注:一点一滴,皆是成果!

http://www.lryc.cn/news/545231.html

相关文章:

  • 分片加载网络图片
  • 考研复试问题总结-数据结构(1)
  • DeepSeek 助力 Vue3 开发:打造丝滑的网格布局(Grid Layout)
  • 架构案例:从初创互联网公司到分布式存储与反应式编程框架的架构设计
  • 51页精品PPT | 农产品区块链溯源信息化平台整体解决方案
  • 【Pytest】setup和teardown的四个级别
  • JavaScript系列03-异步编程全解析
  • Linux学习——退出vi编辑模式
  • 第2章_保护您的第一个应用程序
  • 【AGI】DeepSeek开源周:The whale is making waves!
  • Unity中动态切换光照贴图的方法
  • 第三十四:6.4.【v-model】
  • React底层常见的设计模式
  • 从零基础到通过考试
  • UniApp 按钮组件 open-type 属性详解:功能、场景与平台差异
  • 【无标题】ABP更换MySql数据库
  • 大模型微调入门(Transformers + Pytorch)
  • 【开源免费】基于SpringBoot+Vue.JS网络海鲜市场系统(JAVA毕业设计)
  • 在线会议时, 笔记本电脑的麦克风收音效果差是为什么
  • 理解文件系统
  • 第二十四:5.2【搭建 pinia 环境】axios 异步调用数据
  • Vue2+Element实现Excel文件上传下载预览【超详细图解】
  • C# 装箱(Boxing)与拆箱(Unboxing)
  • 【AD】3-10 原理图PDF导出
  • SQL命令详解之增删改数据
  • Docker 部署 MinIO 对象存储服务
  • IP段转CIDR:原理Java实现
  • 翻译: 深入分析LLMs like ChatGPT 一
  • springboot之HTML与图片生成
  • 数据结构(初阶)(三)----单链表