GLOBAL_AGENT.HTTP_PROXY configuration value: URL protocol must be http:
zzz08900 opened this issue Β· 11 comments
Preflight Checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project follows, as appropriate.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
Issue Details
- Electron Packager Version:
- 14.2.1, 15.4.0
- Electron Version:
- 17.1.2
- Operating System:
- Ubuntu 20.04 x64
- Last Known Working Electron Packager version:
- 13.1.1
Expected Behavior
Building Win32 packages from my Ubuntu machine (with Wine installed) using electron-packager . --platform=win32 --out=./builds
Should get me Win32 artifacts in the ./builds folder.
Actual Behavior
Building Win32 packages from my Ubuntu machine (with Wine installed) using electron-packager . --platform=win32 --out=./builds
results in error message: Unsupported GLOBAL_AGENT.HTTP_PROXY
configuration value: URL protocol must be "http:".
The error originated from global-agent which is an optional dependency of @electron/get.
To Reproduce
- find a Linux machine, create an empty nodeJS project, setup a barebone package.json
- put the following in package.json
"devDependencies": {
"electron": "^17.1.2",
"electron-devtools-installer": "^3.2.0",
"electron-packager": "^15.4.0"
} - try
npx electron-packager . --platform=win32 --out=./builds
, you shoule see the error message
Additional Information
Debug info attached below:
electron-packager Electron Packager 15.4.0
electron-packager Node v14.17.5
electron-packager Host Operating system: linux 5.13.0-30-generic (x64) +0ms
electron-packager Packager Options: {"_":["."],"platform":"win32","out":"./builds","deref-symlinks":true,"derefSymlinks":true,"download":{"rejectUnauthorized":true,"reject-unauthorized":true},"junk":true,"prune":true,"dir":".","protocols":[]} +2ms
electron-packager Target Platforms: win32 +1ms
electron-packager Target Architectures: x64 +0ms
electron-packager Requiring author in package.json, as CompanyName was not specified for win32metadata +0ms
electron-packager Inferring application name from name in {omitted}/package.json +13ms
electron-packager Inferring appVersion from version in {omitted}/package.json +0ms
electron-packager Inferring target Electron version from electron in {omitted}/package.json +5ms
electron-packager Application name: {omitted} +18ms
electron-packager Target Electron version: 17.1.2 +0ms
electron-packager Ignored path regular expressions: [
'/package-lock\.json$',
'/yarn\.lock$',
'/\.git($|/)',
'/node_modules/\.bin($|/)',
'\.o(bj)?$',
'/tmp/electron-packager'
] +0ms
electron-packager Downloading Electron with options {"rejectUnauthorized":true,"reject-unauthorized":true,"platform":"win32","arch":"x64","version":"17.1.2","artifactName":"electron"} +0ms
Unsupported GLOBAL_AGENT.HTTP_PROXY
configuration value: URL protocol must be "http:".
@zzz08900 What is the value of the HTTP_PROXY
environment variable? Or, I guess, GLOBAL_AGENT.HTTP_PROXY
?
This appears to be a regression from #214
CC: @BlackHole1
I found this: https://github.com/gajus/global-agent/blob/f82ad8a151af30f5bf218487d006771c6407bf89/src/utilities/parseProxyUrl.ts#L16
Please check the value of your proxy environment variables
For some reason, the following environment variables are set to undefined in the new release version 1.14.0 GLOBAL_AGENT_HTTP_PROXY, GLOBAL_AGENT_HTTPS_PROXY, GLOBAL_AGENT_NO_PROXY.
I've resolved this issue by downgrading the get package to the previous version 1.13.1.
I've resolved the dependency manually in my package.json file by adding
"resolutions": { "@electron/get": "1.13.1" },
I've tried to unset those environment variables, but they are still present for some reason.
π€ I will give reasons within 12 hours. It is the break si h in the Chinese time zone. πββοΈ
Can you provide a repo url for the demo in order to be able to quickly pinpoint the problem?
I've found the problem, please wait. I will submit a PR later
π This issue has been resolved in version 1.14.1 π
The release is available on:
Your semantic-release bot π¦π
"electron": "^26.2.1"
Operating System:
Windows11 23545.1000
RequestError: Unsupported GLOBAL_AGENT.HTTP_PROXY
configuration value: URL protocol must be "http:".
it still not work and i don`t know how to fix it
@NixerSo5 I encountered the same issue when installing the alpha version and the nightly version. It seems that only the stable version has fixed this bug. My solution isοΌ
$env:ELECTRON_GET_USE_PROXY=1
$env:GLOBAL_AGENT_HTTP_PROXY="http://127.0.0.1:7890"
# Don't chang GLOBAL_AGENT_HTTPS_PROXY
However, it still took me 40 minutes to install electron@v28.0.0-alpha.2. (While installing the stable version only took me a few seconds.
Here's my solution, maybe it will work for you guys: https://cloud.tencent.com/developer/article/2369773