3

I am trying to install electron on my ubuntu 16.04, i already have a working nodejs and npm. But suddenly I am unable to install modules by type: sudo npm install electron

Below is the response am getting:

npm WARN registry Unexpected warning for https://registry.npmjs.org/: 
Miscellaneous Warning EAI_AGAIN: request to 
https://registry.npmjs.org/electron failed, reason: getaddrinfo 
EAI_AGAIN registry.npmjs.org:443
npm WARN registry Using stale package data from 
https://registry.npmjs.org/ due to a request error during 
revalidation.

> electron@1.7.10 postinstall 
/home/arthur/Documents/Programming/Electron/node_modules/electron
> node install.js



 `/home/arthur/Documents/Programming/Electron/node_modules/electron/
install.js:48

throw err ^

Error: read ECONNRESET
at _errnoException (util.js:1024:11)
at TLSWrap.onread (net.js:615:25)
npm WARN y@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@1.7.10 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron@1.7.10 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely 
additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/arthur/.npm/_logs/2017-12-19T10_25_52_312Z-
debug.log
The Nerdy Geek
  • 342
  • 5
  • 16

5 Answers5

4

The issue is related to proxy configuration. Based on this answer, you can try the following.

First, try to remove if there exists your initial config:

npm config rm proxy
npm config rm https-proxy

And optionally if needed, try to set your proxy config

npm config set proxy proxy-url
npm config set https-proxy proxy-url
edkeveked
  • 17,989
  • 10
  • 55
  • 93
1

I tried everything but it seems I was using CENTOS which allowing me to install electron. I got help from FlashJonas: and tried installing electron again and it was installed as expected.

sudo npm install electron -g --verbose --unsafe-perm=true
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
muhammad tayyab
  • 727
  • 7
  • 18
0

Removing the proxy and https-proxy worked for me, just in case there is another person with a similar situation. just enter the following in your terminal:

npm config rm proxy
npm config rm https-proxy
The Nerdy Geek
  • 342
  • 5
  • 16
0

Do Any of the following. It Work for me.

  1. Change Internet Connection.
  2. Delete all electron file and then install npm insatll electron.
  3. Try to install old version of electron.

This Error is because it can't able to download "electron-v11.2.1-win32-x64.zip" file. So Change Internet Connection it work for me.

Pranay
  • 1
0

I am behind a corporate proxy and had similar issues. None of the options above helped. In the end, I followed the instructions below to reconstruct the electron cache manually, so that it will not have to hit the network to download the binaries:

https://www.electronjs.org/docs/v14-x-y/tutorial/installation#custom-mirrors-and-caches

Basically I used a personal laptop (i.e. not behind the proxy) to install the latest electron on some test app, and then copied the %LOCALAPPDATA%\electron\Cache folder from my personal to the corporate laptop. Everything worked fine.

AsGoodAsItGets
  • 2,886
  • 34
  • 49