How to make Electron run on Raspberry Pi

By | July 23, 2017

Electron is absolutely awesome thing! It’s easy for use of HTML, CSS and JavaScript, it’s crossplatform, and many others. And, how complicated is to make it run on Raspberry Pi? It’s pretty easy! Let’s install it!

Log in into SSH as user pi, and if you not have installed NodeJS, execute this: (in Putty/SSH, press right mouse button to paste):

cd /tmp
wget https://nodejs.org/dist/v8.2.1/node-v8.2.1-linux-armv7l.tar.xz
tar xfv node-v8.2.1-linux-armv7l.tar.xz
cd node-v8.2.1-linux-armv7l
sudo cp -R * /usr/local/

And now just download and install Electron

sudo npm install -g electron --unsafe-perm=true --allow-root

If you want to test it, install Electron quick start app

# Clone this repository
git clone https://github.com/electron/electron-quick-start
# Go into the repository
cd electron-quick-start
# Install dependencies
npm install
# Set display
export DISPLAY=:0
# Run the app
npm start

And it’s done! 🙂