Closed vmi closed 3 years ago
Me,too. The problem is mainly in the @electron/get package
It happened to me, too.
for me the install is working fine under ubuntu 18.0.4 LTS
my npm version is npm@6.12.0 my node version is node@v12.11.0
may be this will help you
Me too
evn: MacOS 10.15
patrick@PatrickdeMacBook-Pro casher % npm install electron
electron@7.0.0 postinstall /Users/patrick/code/casher/node_modules/electron node install.js
... and blocked
This is also the case in Windows 10 1903. Even with administrator privileges, the installation cannot succeed.
Me,too. The problem is mainly in the @electron/get package
when i use mirror site it seems that @electron/get request the wrong url:
https://npm.taobao.org/mirrors/electron/v7.0.0/electron-v7.0.0-darwin-x64.zip
in 6.1.2
https://npm.taobao.org/mirrors/electron/6.1.2/electron-v6.1.2-darwin-x64.zip
it not strip 'v' from version number in the dir part .
so different behavior for electron-download from @electron/get package
@nickfan If there is a bug in Electron Get PRs are more than welcome: https://github.com/electron/get
It has a solid test suite so it should be clear where things go and if they work or not 👍
emm,I successfully installed 7.0.0 by replacing the dependency in install.js and package.json in the electronic package. It seems that Taobao doesn't want to cooperate with the changes or other problems. For the time being, we can use the latest version like this. I hope that the author can make some judgments based on China and thank you very much.
"dependencies": {
"@types/node": "^12.0.12",
"extract-zip": "^1.0.3",
"electron-download": "^4.1.0"
},
However, there is still a drawback in this way. When performing the packing operation, you need to manually download the file to the directory. Otherwise, there will still be errors.
Same kind of problem with 7.0.1 (whether behind a proxy or not), but with a timeout error instead of a permission problem.
electron@7.0.1 postinstall /media/fr_romain/DATA/Sites/ordomatic/node_modules/electron node install.js
(node:10614) UnhandledPromiseRejectionWarning: RequestError: connect ETIMEDOUT 140.82.118.4:443 at ClientRequest.
(/media/fr_romain/DATA/Sites/ordomatic/node_modules/got/source/request-as-event-emitter.js:178:14) at Object.onceWrapper (events.js:300:26) at ClientRequest.emit (events.js:215:7) at ClientRequest.origin.emit (/media/fr_romain/DATA/Sites/ordomatic/node_modules/@szmarczak/http-timer/source/index.js:37:11) at TLSSocket.socketErrorListener (_http_client.js:406:9) at TLSSocket.emit (events.js:210:5) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:80:21) (node:10614) 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:10614) [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. npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN ordomatic@1.0.0 No description npm WARN ordomatic@1.0.0 No repository field.
- electron@7.0.1 added 86 packages from 90 contributors and audited 104 packages in 182.269s found 0 vulnerabilities
-- Edit:
same issues
Me,too. The problem is mainly in the @electron/get package
when i use mirror site it seems that @electron/get request the wrong url:
https://npm.taobao.org/mirrors/electron/v7.0.0/electron-v7.0.0-darwin-x64.zip
in 6.1.2
https://npm.taobao.org/mirrors/electron/6.1.2/electron-v6.1.2-darwin-x64.zip
it not strip 'v' from version number in the dir part .
so different behavior for electron-download from @electron/get package
I think the key point of the problem is that when running postinstall, something went wrong. i try to reproduce the problem with "node install.js" in the node_modules directory of electron.
i just manually run "node install.js" in node_modules/electron directory then everything goes ok.
try this
npm_config_electron_mirror="https://npm.taobao.org/mirrors/electron/" npm_config_electron_custom_dir="7.1.0" yarn add electron
try this
npm_config_electron_mirror="https://npm.taobao.org/mirrors/electron/" npm_config_electron_custom_dir="7.1.0" yarn add electron
so, follow this steps:
npm install -g cross-env
cross-env npm_config_electron_mirror="https://npm.taobao.org/mirrors/electron/" npm_config_electron_custom_dir="7.1.0" npm install electron
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
export async function downloadArtifact(
_artifactDetails: ElectronPlatformArtifactDetailsWithDefaults,
): Promise<string> {
const artifactDetails: ElectronArtifactDetails = _artifactDetails.isGeneric
? {
..._artifactDetails,
}
: {
platform: process.platform,
arch: getHostArch(),
..._artifactDetails,
};
ensureIsTruthyString(artifactDetails, 'version');
artifactDetails.version = normalizeVersion(artifactDetails.version);
the artifactDetails.version = normalizeVersion(artifactDetails.version);
just add 'v' for prefix
then `function getArtifactRemoteURL
use this 'v7.1.0' for the default custom dir path
const path = mirrorVar('customDir', opts, details.version);
@MarshallOfSound
same error like this: (node:21640) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, lstat 'C:\Users\ADMINI~1\AppData\Local\Temp\electron-download-tfppVA\electron-v7.1.1-win32-x64.zip'
Still the same with electron@7.1.2 postinstall
> node install.js
(node:9927) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit
(node:10024) UnhandledPromiseRejectionWarning: RequestError: connect ETIMEDOUT 140.82.118.3:443
at ClientRequest.request.once.error (/project/node_modules/got/source/request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:286:20)
at ClientRequest.emit (events.js:203:15)
at ClientRequest.origin.emit.args (/project/node_modules/@szmarczak/http-timer/source/index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:392:9)
at TLSSocket.emit (events.js:198:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:10024) 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:10024) [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.
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)
update: it's fixed now.
change url to:
electron_mirror=https://cdn.npm.taobao.org/dist/electron/
from:
https://github.com/cnpm/cnpmjs.org/issues/1530#issuecomment-561081645
Same here. Version 6x works, version 7x works.
update: it's fixed now.
change url to:
electron_mirror=https://cdn.npm.taobao.org/dist/electron/
from:
It works!
The workaround of specifying environment variables from https://github.com/castlabs/electron-releases/issues/45#issuecomment-549385236 worked for me:
npx cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://localhost:3128 npm install electron
Where http://localhost:3128
is 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:
npx cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://localhost:3128 node node_modules/electron/install
To hide details of installation, you can add following into your package.json
"scripts": {
"preinstall": "npm run install-electron",
"install-electron": "cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://your_proxy npm install electron"
},
The workaround of specifying environment variables from castlabs/electron-releases#45 (comment) worked for me:
npx cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://localhost:3128 npm install electron
Where
http://localhost:3128
is 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:
npx cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://localhost:3128 node node_modules/electron/install
It works for me.
The Electron version reported on this issue is no longer supported. See our supported versions documentation.
If this is still reproducible on a supported version, please open a new issue with any other new information that a maintainer should know.
Thank you for taking the time to report this issue and helping to make Electron better! Your help is appreciated.
update: it's fixed now.
change url to:
electron_mirror=https://cdn.npm.taobao.org/dist/electron/
from:
It works for me.
No, the CDN domain name will be deactivated soon. Use the following settings directly
registry=https://registry.npmmirror.com
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
ELECTRON_CUSTOM_DIR="{{ version }}"
ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/
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
work for me
npm config rm proxy npm config rm https-proxy
https://stackoverflow.com/questions/47885108/unable-to-install-electron-from-npm
work for me
npm config rm proxy npm config rm https-proxy
https://stackoverflow.com/questions/47885108/unable-to-install-electron-from-npm
thank you so much!!!
Preflight Checklist
Issue Details
Expected Behavior
Successful installation behind proxy.
Actual Behavior
Installation failed.
But, successful installation 6.1.2.
Additional Information
I set
%HOMEDRIVE%%HOMEPATH%\.npmrc
as follows: