0

I was trying to install Electron using NPM, and this showed up:

adi@LMToshi2 ~ $ npm install electron --save-dev --save-exact
npm ERR! Linux 4.8.0-53-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "electron" "-
-save-dev" "--save-exact"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read

npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! Linux 4.8.0-53-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "electron" "--save-dev" "--save-exact"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read

npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! Linux 4.8.0-53-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "electron" "--save-dev" "--save-exact"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read

npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
WARN engine hawk@6.0.2: wanted: {"node":">=4.5.0"} (current: {"node":"4.2.6","npm":"3.5.2"})

BTW: I am not in a Proxy.

αғsнιη
  • 35,660
  • npm install electron --save-dev --save-exact will work after following the instructions in this answer: https://askubuntu.com/questions/717349/how-to-build-electron/1025279#1025279 – karel Apr 15 '18 at 16:21

1 Answers1

1

Make sure you have the latest version of Node installed! sudo apt install node doesn't install the latest version, it looks like you have version 4.2.6 and electron wants something newer or equal to version 4.5.0. Try installing node with this method:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

then type:

sudo apt-get install -y nodejs

(Source: https://nodejs.org/en/download/package-manager/)