I was trying to install the React Dev Tools with the following command:
npm install -g react-devtools
Almost all of the steps succeed, until it gets to the step where it installs electron, at which point I get the following error:
1057 error code 1
1058 error path C:\Users\<username>\AppData\Roaming\npm\node_modules\react-devtools\node_modules\electron
1059 error command failed
1060 error command C:\Windows\system32\cmd.exe /d /s /c node install.js
1061 error RequestError: getaddrinfo ENOTFOUND github.com
1061 error at ClientRequest.<anonymous> (C:\Users\<username>\AppData\Roaming\npm\node_modules\react-devtools\node_modules\got\dist\source\core\index.js:970:111)
1061 error at Object.onceWrapper (node:events:628:26)
1061 error at ClientRequest.emit (node:events:525:35)
1061 error at origin.emit (C:\Users\<username>\AppData\Roaming\npm\node_modules\react-devtools\node_modules\@szmarczak\http-timer\dist\source\index.js:43:20)
1061 error at TLSSocket.socketErrorListener (node:_http_client:502:9)
1061 error at TLSSocket.emit (node:events:513:28)
1061 error at emitErrorNT (node:internal/streams/destroy:151:8)
1061 error at emitErrorCloseNT (node:internal/streams/destroy:116:3)
1061 error at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
1061 error at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
1062 verbose exit 1
Other npm packages install just fine.
My first thought based on Q&As like this one was that I was having some proxy issue. The confusing thing about that is that other installs work just fine, and I have my http_proxy
and https_proxy
environment variables set (and my understanding is that npm should request that).
What other things might I try here?
I found the answer here. It turns out that this is a bug where the proxy details aren't passed correctly in the Electron post-install script.
When I tried the following command, the install worked just fine:
npx cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=$https_proxy npm install -g react-devtools