Electron-builder: Proxy authentication error for nsis download

Created on 2 Mar 2018  Â·  9Comments  Â·  Source: electron-userland/electron-builder


  • 20.2.0:

  • win x64:
  • Execution Plattform: win 10 x64
  • node version: v.9.7.0
  • npm version: 5.6.0



I using electron in a company behing a proxy. I have set npm to use proxy and it works. But when I try to run electron installer it tries to download nsis without proxy and this fails. What can I do to make electron builder to use proxy?

  • package.json:

{
"name": "diaXDashboard",
"main": "./app/index.js",
"scripts": {
"postinstall": "install-app-deps",
"start": "npm install && electron ./app",
"pack": "app --dir",
"dist": "build"
},
"build": {
"appId": "diax_Dashboard",
"win": {
"target": "portable",
"icon": "build/icon.ico"
}
},
"dependencies": {},
"devDependencies": {
"electron": "latest",
"electron-builder": "20.2.0"
}
}

  • log of Terminal:

diaXDashboard@ dist d:devdiaxdiax-incubatordashboard
build

• electron-builder version=20.2.0
• loaded configuration file=package.json ("build" field)
• effective config config=
directories:
output: dist
buildResources: build
appId: diax_Dashboard
win:
target: portable
icon: build/icon.ico

• two package.json structure is used devPackageFile=d:devdiaxdiax-incubatordashboardpackage.json appPackageFile=d:devdiaxdiax-incubatordashboardapppackage.json
• writing effective config file=distelectron-builder.yaml
• no native production dependencies
• packaging platform=win32 arch=x64 electron=1.8.2 appOutDir=distwin-unpacked
• spawning command=d:devdiaxdiax-incubatordashboardnode_modules7zip-bin-winx647za.exe x -bd C:Usersmat1plAppDataLocalelectronCacheelectron-v1.8.2-win32-x64.zip -aoa -od:devdiaxdiax-incubatordashboarddistwin-unpacked

7-Zip (a) 18.01 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2018-01-28

Scanning the drive for archives:
1 file, 55207481 bytes (53 MiB)

Extracting archive: C:Usersmat1plAppDataLocalelectronCacheelectron-v1.8.2-win32-x64.zip

Path = C:Usersmat1plAppDataLocalelectronCacheelectron-v1.8.2-win32-x64.zip
Type = zip
Physical Size = 55207481

Everything is Ok

Files: 117
Size: 141933313
Compressed: 55207481
• exited command=7za.exe code=0 pid=23108
• spawning command=d:devdiaxdiax-incubatordashboardnode_modulesapp-builder-bin-winx64app-builder.exe icon --format ico --root d:devdiaxdiax-incubatordashboardbuild --root d:devdiaxdiax-incubatordashboard --out d:devdiaxdiax-incubatordashboarddist.icon-ico --input build/icon.ico
 • path doesn't exist path=d:devdiaxdiax-incubatordashboardbuildbuildicon.ico
 • path resolved outputFormat=ico path=d:devdiaxdiax-incubatordashboardbuildicon.ico
• exited command=app-builder.exe code=0 pid=16456 out={"icons":[{"file":"d:\dev\diax\diax-incubator\dashboard\build\icon.ico","size":0}]}
• spawning command=d:devdiaxdiax-incubatordashboardnode_modulesapp-builder-bin-winx64app-builder.exe download-artifact --url https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-1.9.0/winCodeSign-1.9.0.7z --name winCodeSign-1.9.0 --sha512 cyhO9Mv5MTP2o9dwk/+qs0KvuO9CbDhjEJXA2ujpvhcsk5zmc+zY9iqiWXVzOuibTLYNC3qZiuFlJrrCT2kldw==
 • found existing path=C:Usersmat1plAppDataLocalelectron-buildercachewinCodeSignwinCodeSign-1.9.0
• exited command=app-builder.exe code=0 pid=13680 out=C:Usersmat1plAppDataLocalelectron-buildercachewinCodeSignwinCodeSign-1.9.0
• executing file=C:Usersmat1plAppDataLocalelectron-buildercachewinCodeSignwinCodeSign-1.9.0rcedit.exe args=d:devdiaxdiax-incubatordashboarddistwin-unpackeddiaX_Dashboard.exe --set-version-string FileDescription diaX_Dashboard --set-version-string ProductName diaX_Dashboard --set-version-string LegalCopyright Copyright © 2018 --set-file-version 1.2.14 --set-product-version 1.2.14.0 --set-version-string InternalName diaX_Dashboard --set-version-string OriginalFilename --set-version-string CompanyName Company --set-icon d:devdiaxdiax-incubatordashboardbuildicon.ico
• executed file=C:Usersmat1plAppDataLocalelectron-buildercachewinCodeSignwinCodeSign-1.9.0rcedit.exe
wine&sign: 0s 488ms
• building target=portable file=distdiaX_Dashboard 1.2.14.exe archs=x64
• spawning command=d:devdiaxdiax-incubatordashboardnode_modulesapp-builder-bin-winx64app-builder.exe download-artifact --url https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.1.13/nsis-3.0.1.13.7z --name nsis-3.0.1.13 --sha512 WtEinikNm5ES8WSf1ZDefuUahn7iewbtVmJrRg4xWfm4eaESSJKy9pKIMRMgszdKw5e3YooCOqObnC5qJIfTLA==
 • found existing path=C:Usersmat1plAppDataLocalelectron-buildercachensisnsis-3.0.1.13
• exited command=app-builder.exe code=0 pid=23216 out=C:Usersmat1plAppDataLocalelectron-buildercachensisnsis-3.0.1.13
• executing file=d:devdiaxdiax-incubatordashboardnode_modules7zip-bin-winx647za.exe args=a -bd -mx=9 -mtc=off -mtm=off -mta=off d:devdiaxdiax-incubatordashboarddistdiaX_Dashboard-1.2.14-x64.nsis.7z . cwd=d:devdiaxdiax-incubatordashboarddistwin-unpacked
nsis package, x64: 45s 684ms
• spawning command=d:devdiaxdiax-incubatordashboardnode_modulesapp-builder-bin-winx64app-builder.exe download-artifact --url https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.3.0/nsis-resources-3.3.0.7z --name nsis-resources-3.3.0 --sha512 4okc98BD0v9xDcSjhPVhAkBMqos+FvD/5/H72fTTIwoHTuWd2WdD7r+1j72hxd+ZXxq1y3FRW0x6Z3jR0VfpMw==
 • downloading path=C:Usersmat1plAppDataLocalelectron-buildercachensisnsis-resources-3.3.0 url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.3.0/nsis-resources-3.3.0.7z
 • computing effective URL currentUrl=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.3.0/nsis-resources-3.3.0.7z initialUrl=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.3.0/nsis-resources-3.3.0.7z
 • computing effective URL currentUrl=https://github-production-release-asset-2e65be.s3.amazonaws.com/65527128/a66824a4-87df-11e7-82f2-5300303e3c85?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180302%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180302T121732Z&X-Amz-Expires=300&X-Amz-Signature=87e3cd4153d5c89e0c1a5db588f7bca9b8a642cb401eef31ea29dfe133f0ca46&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dnsis-resources-3.3.0.7z&response-content-type=application%2Foctet-stream initialUrl=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.3.0/nsis-resources-3.3.0.7z
 ⨯ Get https://github-production-release-asset-2e65be.s3.amazonaws.com/65527128/a66824a4-87df-11e7-82f2-5300303e3c85?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180302%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180302T121732Z&X-Amz-Expires=300&X-Amz-Signature=87e3cd4153d5c89e0c1a5db588f7bca9b8a642cb401eef31ea29dfe133f0ca46&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dnsis-resources-3.3.0.7z&response-content-type=application%2Foctet-stream: Proxy Authentication Required
github.com/develar/app-builder/pkg/download.follow.func2
/Users/develar/go/src/github.com/develar/app-builder/pkg/download/downloader.go:135
github.com/develar/app-builder/pkg/download.follow
/Users/develar/go/src/github.com/develar/app-builder/pkg/download/downloader.go:176
github.com/develar/app-builder/pkg/download.Download
/Users/develar/go/src/github.com/develar/app-builder/pkg/download/downloader.go:61
github.com/develar/app-builder/pkg/download.DownloadArtifact
/Users/develar/go/src/github.com/develar/app-builder/pkg/download/artifactDownloader.go:80
github.com/develar/app-builder/pkg/download.ConfigureArtifactCommand.func1
/Users/develar/go/src/github.com/develar/app-builder/pkg/download/artifactDownloader.go:25
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(actionMixin).applyActions
/Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/actions.go:28
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(
Application).applyActions
/Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/app.go:557
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(Application).execute
/Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/app.go:390
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(
Application).Parse
/Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/app.go:222
main.main
/Users/develar/go/src/github.com/develar/app-builder/main.go:59
runtime.main
/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:198
runtime.goexit
/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361

• exited command=app-builder.exe code=1 pid=15800
• async task error error=d:devdiaxdiax-incubatordashboardnode_modulesapp-builder-bin-winx64app-builder.exe exited with code 1
• async task error error=d:devdiaxdiax-incubatordashboardnode_modulesapp-builder-bin-winx64app-builder.exe exited with code 1
Error: d:devdiaxdiax-incubatordashboardnode_modulesapp-builder-bin-winx64app-builder.exe exited with code 1
at ChildProcess.childProcess.once.code (d:devdiaxdiax-incubatordashboardnode_modulesbuilder-utilsrcutil.ts:252:14)
at Object.onceWrapper (events.js:219:13)
at ChildProcess.emit (events.js:127:13)
at maybeClose (internal/child_process.js:936:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
From previous event:
at AsyncTaskManager.add (d:devdiaxdiax-incubatordashboardnode_modulesbuilder-utilsrcasyncTaskManager.ts:15:20)
at d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-libsrctargetsnsisNsisTarget.ts:465:17
at Generator.next ()
From previous event:
at NsisTarget.computeCommonInstallerScriptHeader (d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-libouttargetsnsisNsisTarget.js:553:11)
at d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-libsrctargetsnsisNsisTarget.ts:210:37
From previous event:
at NsisTarget.buildInstaller (d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-libouttargetsnsisNsisTarget.js:336:11)
at d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-libsrctargetsnsisNsisTarget.ts:96:18
at Generator.next ()
From previous event:
at NsisTarget.finishBuild (d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-libouttargetsnsisNsisTarget.js:214:11)
at d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-libsrcpackager.ts:380:36
at Generator.next ()
at runCallback (timers.js:763:18)
at tryOnImmediate (timers.js:734:5)
at processImmediate (timers.js:716:5)
From previous event:
at Packager.doBuild (d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-liboutpackager.js:441:11)
at d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-libsrcpackager.ts:316:52
at Generator.next ()
at d:devdiaxdiax-incubatordashboardnode_modulesgraceful-fsgraceful-fs.js:99:16
at d:devdiaxdiax-incubatordashboardnode_modulesgraceful-fsgraceful-fs.js:43:10
at FSReqWrap.oncomplete (fs.js:153:20)
From previous event:
at Packager._build (d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-liboutpackager.js:385:11)
at d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-libsrcpackager.ts:278:23
at Generator.next ()
at runCallback (timers.js:763:18)
at tryOnImmediate (timers.js:734:5)
at processImmediate (timers.js:716:5)
From previous event:
at Packager.build (d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-liboutpackager.js:341:11)
at d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-libsrcindex.ts:50:40
at Generator.next ()
From previous event:
at build (d:devdiaxdiax-incubatordashboardnode_moduleselectron-builder-liboutindex.js:47:21)
at build (d:devdiaxdiax-incubatordashboardnode_moduleselectron-buildersrcbuilder.ts:228:10)
at then (d:devdiaxdiax-incubatordashboardnode_moduleselectron-buildersrcclicli.ts:48:33)
at runCallback (timers.js:763:18)
at tryOnImmediate (timers.js:734:5)
at processImmediate (timers.js:716:5)
From previous event:
at Object.args [as handler] (d:devdiaxdiax-incubatordashboardnode_moduleselectron-buildersrcclicli.ts:48:33)
at Object.runCommand (d:devdiaxdiax-incubatordashboardnode_modulesyargslibcommand.js:235:44)
at Object.parseArgs [as _parseArgs] (d:devdiaxdiax-incubatordashboardnode_modulesyargsyargs.js:1042:24)
at Object.get [as argv] (d:devdiaxdiax-incubatordashboardnode_modulesyargsyargs.js:957:21)
at Object. (d:devdiaxdiax-incubatordashboardnode_moduleselectron-buildersrcclicli.ts:42:15)
at Module._compile (module.js:662:30)
at Object.Module._extensions..js (module.js:673:10)
at Module.load (module.js:575:32)
at tryModuleLoad (module.js:515:12)
at Function.Module._load (module.js:507:3)
at Function.Module.runMain (module.js:703:10)
at startup (bootstrap_node.js:193:16)
at bootstrap_node.js:660:3

feature

Most helpful comment

I have the same question. Corporate proxy.

All 9 comments

Please try 20.3.0.

I'm using electron-builder 20.3.1 and still getting the same error:
 • downloading path=C:\Users\mat1pl\AppData\Local\electron-builder\cache\nsis\nsis-3.0.1.13 url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.1.13/nsis-3.0.1.13.7z  ⨯ Get https://github-production-release-asset-2e65be.s3.amazonaws.com/65527128/a3c5da4a-4089-11e7-9f7c-87700ea73ffb?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180307%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180307T124057Z&X-Amz-Expires=300&X-Amz-Signature=a2aba691d30d9c68848b550cc300afe6326ae08d8fb9337d538c6735729acfed&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dnsis-3.0.1.13.7z&response-content-type=application%2Foctet-stream: Proxy Authentication Required

Please try to run with env NO_PROXY=*

I tried to use your setting, but in our company it is impossible to directly access the internet, so this does not work. What I need is to provide the proxy credentials (username and password) to the download programm.

Electron build downloads (nsis, winCodeSign) not working behind enterprise proxy : npm proxy settings are not used.
No way to use npm proxy settings ? (.npmrc ...)

I have the same question. Corporate proxy.

I only want to be not hated please anyone that has ongoing business
proceedings within iam has my full blessings to proceed

On Jan 3, 2019 11:24 AM, "Alex Lee" notifications@github.com wrote:

I have the same question. Corporate proxy.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/electron-userland/electron-builder/issues/2656#issuecomment-451249532,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AkatxPa7ZbQArYUx02vUYM8Xxel7Egowks5u_ljVgaJpZM4SZ2cH
.

is there a way to download electron-builder-binaries and make electron-builder point to same?

@cynx Yes.

So far, this is the workaround that I've found:

  1. Try electron-builder command (either publish, or dist. It shouldn't matter, you'll be getting an error either way.)
  2. Wait for the error to stop the command.
  3. The log will show the URL for the file that electron-builder was trying to download. Copy the URL and open it in a browser to download manually.
  4. Create a folder in your project directory called cache.
  5. Unzip the files and place in the cache folder.
  6. Run the command again, this time with the following environment variables: ELECTRON_CACHE=%cd%\\cache and ELECTRON_BUILDER_CACHE=%cd%\\cache. (_Note: The %cd% is a Windows way to get the directory from powershell. This may not work with Mac. Try looking at cross-env for easy environment setting in all systems. https://www.npmjs.com/package/cross-env_)
  7. This will run the command but point the builder to your cache directory. It may throw an error about the file not existing. If this happens, it means you may need to unzip the file into the folder (look for the error log to see what the file/folder should be named).
  8. Success!

If you are trying to do this for different operating systems, you'll need to do the same for the other binaries. Be prepared to get errors, but the errors will tell you what the filenames should be.

Feel free to message me for help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StickNitro picture StickNitro  Â·  3Comments

AidanNichol picture AidanNichol  Â·  3Comments

omarkilani picture omarkilani  Â·  3Comments

talarari picture talarari  Â·  3Comments

leo picture leo  Â·  3Comments