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

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.kler.cn/a/568729.html

相关文章:

  • Python与Web3.py库:构建去中心化应用的未来
  • Java对象字段拷贝最佳实践:BeanUtils、Lombok Builder、MapStruct 深度解析(附Demo)
  • 特辣的海藻!7
  • PostgreSQL 生产环境升级指南:pg_upgrade 快速完成版本升级!
  • 入门大模型的学习路线是什么?
  • 十一、Spring Boot:使用JWT实现用户认证深度解析
  • All in One: Multi-Task Prompting for Graph Neural Networks学习笔记
  • 【面试】Java面试频繁问到的题最新整理(附答案)
  • [Lc滑动窗口_1] 长度最小的数组 | 无重复字符的最长子串 | 最大连续1的个数 III | 将 x 减到 0 的最小操作数
  • 火山引擎 DeepSeek R1 API 使用小白教程
  • 使用 ASP.NET Core 创建和下载 zip 文件
  • 剖析RabbitMQ消息可靠投递
  • 算法day4 dfs搜索2题
  • Flask-Restful
  • APP爬取:基于Appium的App数据爬取实战详解
  • 苹果产品自助网址
  • 【考试大纲】高级网络规划设计师考试大纲
  • 各章节详细总结与 Vue 学习收尾
  • Vscode 便用快捷键设置教程
  • 【赵渝强老师】Kafka消息的消费模式