Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationEventAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.


Proxy環境下でElectron7系以降をnpm installするとENOTFOUND github.comエラーになるのを解消する


  • Node.js v13.10.1
  • npm v6.14.2
  • Electron v8.0.3


Proxy環境下でElectron6系はnpm install出来ていたのに、

Electron7系にアップデートしてnpm installを実行するとgetaddrinfo ENOTFOUND github.comコケるという事象が発生しました。

$ git clone https://github.com/electron/electron-quick-start
$ cd electron-quick-start
$ cat package.json
  "name": "electron-quick-start",
  "version": "1.0.0",
  "description": "A minimal Electron application",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  "repository": "https://github.com/electron/electron-quick-start",
  "keywords": [
  "author": "GitHub",
  "license": "CC0-1.0",
  "devDependencies": {
    "electron": "^8.0.3"
$ npm install

> core-js@3.6.4 postinstall /Users/geekduck/Downloads/electron-quick-start/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> electron@8.0.3 postinstall /Users/geekduck/Downloads/electron-quick-start/node_modules/electron
> node install.js

(node:54108) UnhandledPromiseRejectionWarning: RequestError: getaddrinfo ENOTFOUND github.com
    at ClientRequest.<anonymous> (/Users/geekduck/Downloads/electron-quick-start/node_modules/got/source/request-as-event-emitter.js:178:14)
    at Object.onceWrapper (events.js:423:26)
    at ClientRequest.emit (events.js:328:22)
    at ClientRequest.EventEmitter.emit (domain.js:485:12)
    at ClientRequest.origin.emit (/Users/geekduck/Downloads/electron-quick-start/node_modules/@szmarczak/http-timer/source/index.js:37:11)
    at TLSSocket.socketErrorListener (_http_client.js:432:9)
    at TLSSocket.emit (events.js:316:20)
    at TLSSocket.EventEmitter.emit (domain.js:485:12)
    at emitErrorNT (internal/streams/destroy.js:84:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:54108) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:54108) [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.
added 86 packages from 96 contributors and audited 103 packages in 33.644s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities




ELECTRON_GET_USE_PROXY ... Electron本体のダウンロード時にプロキシを使うかどうか
GLOBAL_AGENT_HTTP_PROXY ... Electron本体のダウンロード時に使用するhttpプロキシ
GLOBAL_AGENT_HTTPS_PROXY ... Electron本体のダウンロード時に使用するhttpsプロキシ


export ELECTRON_GET_USE_PROXY=1 # 値は1でもtrueでもなんでも良い
export GLOBAL_AGENT_HTTP_PROXY=http://proxy.example.com:8080
export GLOBAL_AGENT_HTTPS_PROXY=https://proxy.example.com:8080


set -x ELECTRON_GET_USE_PROXY 1 # 値は1でもtrueでもなんでも良い
set -x GLOBAL_AGENT_HTTP_PROXY http://proxy.example.com:8080
set -x GLOBAL_AGENT_HTTPS_PROXY https://proxy.example.com:8080


Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Help us understand the problem. What are the problem?