node.js - 如何为 Electron-builder 配置设置 github 代理?

标签 node.js npm electron electron-builder

我正在安全的封闭网络下工作,我的 Electron 构建器依赖项无法更新/下载它们的依赖项,因此我需要在 github 代理后面工作才能下载它们, 但我不知道在哪里设置它,

    13:30:09][Step 12/15] > electron-builder --win --x64
[13:30:09][Step 12/15] 
[13:30:10][Step 12/15]   • electron-builder version=20.8.1
[13:30:10][Step 12/15]   • artifacts will be published if draft release exists reason=CI detected
[13:30:11][Step 12/15]   • loaded configuration file=D:\BuildAgent\work\4247f9413726d058\electron-builder.json
[13:30:11][Step 12/15]   • description is missed in the package.json appPackageFile=D:\BuildAgent\work\4247f9413726d058\package.json
[13:30:11][Step 12/15]   • author is missed in the package.json appPackageFile=D:\BuildAgent\work\4247f9413726d058\package.json
[13:30:20][Step 12/15]   • no native production dependencies
[13:30:21][Step 12/15]   • packaging       platform=win32 arch=x64 electron=1.8.4 appOutDir=app-builds\win-unpacked
[13:30:55][Step 12/15]   • downloading               path=D:\BuildAgent\temp\buildTmp\electron-builder-cache\winCodeSign\winCodeSign-2.0.0 url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.0.0/winCodeSign-2.0.0.7z
[13:30:55][Step 12/15]   ⨯ Get https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.0.0/winCodeSign-2.0.0.7z: proxyconnect tcp: tls: oversized record received with length 20527

最佳答案

您提到您的构建在代理后面运行,因此请尝试在代理地址中使用 http 而不是 https:

导出 HTTPS_PROXY="http://myproxy.com:8080"

而不是

导出 HTTPS_PROXY="https://myproxy.com:8080"

从这里开始:

https://github.com/jspm/github/issues/59

关于node.js - 如何为 Electron-builder 配置设置 github 代理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50622859/

相关文章:

node.js - 如何制作和存储帖子标题的子弹?

node.js - MongoDB 设置数据库脚本(基于 NodeJS 的项目)

angularjs - 在node_modules中找不到ag-grid-angular/main文件夹

javascript - 多次加载未循环的 gif 动画

indexeddb - 我的数据在哪里?使用 PouchDb 和 Electron ......无处可寻

javascript - For 循环内的 NodeJS 和 Mongoose 回调

javascript - NodeJS 中将字符串转换为对象

node.js - Node 版本需要升级吗?但它比推荐的要高?

node.js - 安装 NPM 包后将文件移至根目录

javascript - 点击事件关闭 Electron 应用