electron: Installation electron failed
Issue Details
There was an error when I executed the command npm i -D electron@latest.
(node:29679) UnhandledPromiseRejectionWarning: RequestError: connect ECONNREFUSED 0.0.0.0:443 at ClientRequest.<anonymous> (/node_modules/@electron/get/node_modules/got/source/request-as-event-emitter.js:178:14) at Object.onceWrapper (events.js:291:20) at ClientRequest.emit (events.js:208:15) at ClientRequest.origin.emit (/node_modules/@szmarczak/http-timer/source/index.js:37:11) at TLSSocket.socketErrorListener (_http_client.js:399:9) at TLSSocket.emit (events.js:203:13) at emitErrorNT (internal/streams/destroy.js:91:8) at emitErrorAndCloseNT (internal/streams/destroy.js:59:3) at processTicksAndRejections (internal/process/task_queues.js:77:11) (node:29679) 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:29679) [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.
The node version:v12.8.1 The operating system:Mac osx10.15
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (7 by maintainers)
@HeiShanLaoYao889
Try
@amorist
cdn.npm.taobao.orgis not in use now.add a path.txt in
node_modules/electronfolder, and putelectronorelectron.exeinto the path.txt, and download version you want unzip intonode_modules/electron/distit work.在node_modules/electron文件夹下建个path.txt, 写进electron或是electron.exe(windows),去淘宝镜像上下载个对应版本的electron,解压到node_modules/electron/dist(没有就新建一个)文件夹下。
npx cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://140.82.113.3:443 yarnworks for me.140.82.113.3isgithub.comIP.use
https://ping.chinaz.com/github.comto get github.com`s IPI see your id is
Hei Shan Lao Yao. I thinkGFWcaused your problem. Try add an environment variable to your system.