electron: Behind proxy, installation failed with 7.0.0, but works with 6.1.2
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for an issue that matches the one I want to file, without success.
Issue Details
- Electron Version:
- 7.0.0
- Operating System:
- Windows 10 (1709)
- Last Known Working Electron version:
- 6.1.2
Expected Behavior
Successful installation behind proxy.
Actual Behavior
Installation failed.
C:\Users\vmi>npm -g i electron
C:\Program Files\nodejs\electron -> C:\Program Files\nodejs\node_modules\electron\cli.js
> electron@7.0.0 postinstall C:\Program Files\nodejs\node_modules\electron
> node install.js
(node:20112) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, lstat 'C:\Users\vmi\AppData\Local\Temp\electron-download-W5hdD0\electron-v7.0.0-win32-x64.zip'
(node:20112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:20112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
+ electron@7.0.0
added 59 packages from 67 contributors in 11.229s
But, successful installation 6.1.2.
C:\Users\vmi>npm -g rm electron
removed 59 packages in 0.803s
C:\Users\vmi>npm -g i electron@6.1.2
C:\Program Files\nodejs\electron -> C:\Program Files\nodejs\node_modules\electron\cli.js
> electron@6.1.2 postinstall C:\Program Files\nodejs\node_modules\electron
> node install.js
Downloading tmp-20364-1-SHASUMS256.txt-6.1.2
[============================================>] 100.0% of 5.15 kB (5.15 kB/s)
+ electron@6.1.2
added 145 packages from 140 contributors and updated 1 package in 244.893s
Additional Information
I set %HOMEDRIVE%%HOMEPATH%\.npmrc as follows:
proxy=http://PROXY_USER:PROXY_PW@PROXY_HOST:8080/
https-proxy=http://PROXY_USER:PROXY_PW@PROXY_HOST:8080/
noproxy=localhost,127.0.0.1,192.168.,10.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 12
- Comments: 25 (2 by maintainers)
The workaround of specifying environment variables from https://github.com/castlabs/electron-releases/issues/45#issuecomment-549385236 worked for me:
Where
http://localhost:3128is the URL of the proxy I connect through (in this case connecting through cntlm)If you’ve already installed the electron package but downloading the electron binary failed, you could run:
It works for me.
update: it’s fixed now.
change url to:
from:
https://github.com/cnpm/cnpmjs.org/issues/1530#issuecomment-561081645
Same kind of problem with 7.0.1 (whether behind a proxy or not), but with a timeout error instead of a permission problem.
– Edit:
No, the CDN domain name will be deactivated soon. Use the following settings directly
In this way, both the electronic ontology and the builder can be used normally. The only problem is that the Taobao image will fail to synchronize from time to time, and the normal electronic release version may be lost
Still the same with electron@7.1.2 postinstall
EDIT: meanwhile they released v7.1.3 and my company added 140.82.118.4 and 114.55.80.225 to the whitelist. When it gives ETIMEDOUT it’s a company configuration issue (or at least fixable by the proxy maintainer)
so, follow this steps:
it works,but it’s still a temporary solution.
and i think, the reason for this is electron/get simplify the process of url combine,but cause the different url for the dir part
https://github.com/electron/get/blob/49a318111b2838486f7778f27b94d992772b8eb7/src/index.ts#L57
the
artifactDetails.version = normalizeVersion(artifactDetails.version);just add ‘v’ for prefixthen ```function getArtifactRemoteURL`` use this ‘v7.1.0’ for the default custom dir path
https://github.com/electron/get/blob/49a318111b2838486f7778f27b94d992772b8eb7/src/artifact-utils.ts#L47
@MarshallOfSound
when i use mirror site it seems that @electron/get request the wrong url:
in 6.1.2
it not strip ‘v’ from version number in the dir part .
so different behavior for electron-download from @electron/get package