Installing an electron on ubuntu

When I try to install an electron on Ubuntu 15.04 using

sudo npm install electron-prebuilt -g

This is what I get

 /usr/local/bin/electron -> /usr/local/lib/node_modules/electron-prebuilt/cli.js > electron-prebuilt@0.28.3 postinstall /usr/local/lib/node_modules/electron-prebuilt > node install.js Downloading electron-v0.28.3-linux-x64.zip Error: tunneling socket could not be established, cause=139936635598656:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:795: /usr/local/lib/node_modules/electron-prebuilt/install.js:15 throw err ^ Error: tunneling socket could not be established, cause=139936635598656:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:795: npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian npm ERR! electron-prebuilt@0.28.3 postinstall: `node install.js` npm ERR! Exit status 8 npm ERR! npm ERR! Failed at the electron-prebuilt@0.28.3 postinstall script. npm ERR! This is most likely a problem with the electron-prebuilt package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node install.js npm ERR! You can get their info via: npm ERR! npm owner ls electron-prebuilt npm ERR! There is likely additional logging output above. npm ERR! System Linux 3.19.0-18-generic npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "electron-prebuilt" npm ERR! cwd /usr/bin npm ERR! node -v v0.10.25 npm ERR! npm -v 1.4.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /usr/bin/npm-debug.log npm ERR! not ok code 0 

I tried

Creating a system link for node using the command: ln -s node nodejs in the /usr/bin/

and

install node-legacy package: sudo apt-get install node-legacy as suggested here with no luck.

Could not find anything else in other forums. Please, help. Thanks in advance.

+7
source share
7 answers

using:

ELECTRON_MIRROR = https://npm.taobao.org/mirrors/electron/ npm install

+4
source

Most likely you are behind a proxy.

You can disable it or do the work of installing npm behind a proxy server (see this question).

+2
source

You entered it incorrectly install nodejs-legacy

 sudo apt-get install nodejs-legacy 

to fix it, and then continue installing the electron

 sudo npm install electron-prebuilt -g 
0
source
 sudo npm install electron -g 

It worked for me

0
source

The following steps helped me: (Assuming host and npm are already installed)

  1. Npm package updated to the latest version: -

    sudo npm install npm @ last -g

  2. An electron is installed with the following switches:

    sudo npm install electronic -g - -verbose --unsafe-perm = true --allow-root

Corrections / suggestions from experienced people are always welcome. Hope this helps someone.

0
source

First install the latest version of node and npm

 $ curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - $ sudo apt-get install -y nodejs 

the latest npm version now 6.9.0 , check npm version with npm --version if npm version - 6.4.1 just update npm first

 $ npm install -g npm 

If you have permission issues caused by sudo , then you can cd in .npm-global

 $ cd /home/user_home_directory/.npm-global/ 

using the chmod to change permissions on all files and directories in this folder:

 $ sudo chmod 777 * -R 

After installation, you should add this line to the end of the .bashrc :

 export PATH="/home/user_home_directory/.npm-global/bin:$PATH" 

After saving .bashrc only source it

 $ source .bashrc 

After everything is done, you can install electron globally

 $ npm install -g electron 
0
source

I came here because my last application was not installed on Ubuntu. In case someone has the same problem, go to the sudo dpkg -i <na,e of your install/build file> builds and run it from the terminal using: sudo dpkg -i <na,e of your install/build file> ps. I have not found this solution anywhere, so I posted here

0
source

All Articles