Electron not working on Raspberry Pi
Solution 1
Unfortunately the reason for that error is that Electron currently does not support ARM devices. We will have to wait until it is implemented
See this issue https://github.com/atom/electron/issues/1702
-- Update
As noted by @skeggse, Electron now does support ARM.
1 Get the dependecies going
apt-get install libgtk2.0-0 libnotify4 libgconf2-4 libnss3 node npm
2 Download the latest arm release called electron-...-linux-arm.zip from here
3
unzip electron-...-linux-arm.zip
4 go inside the folder and double click the file named electron
5 Have fun!
Solution 2
Depending on which Raspberry Pi you have it may be an incompatible binary. The electron prebuilt binaries, I believe, target armv7-hf. Try building electron from source. The instructions can be found here https://github.com/atom/electron/blob/master/docs/development/build-instructions-linux.md
Note that if you are interested in using hardware float support (at least prior to RPiB+) you might want to run Raspbian or another port with hard-float support. (ref)
Solution 3
Connect to Raspberry SSH as user pi, and execute this:
# 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
stoeffn
Updated on July 20, 2022Comments
-
stoeffn almost 2 years
At the moment, I am developing a "kiosk" application for my Raspberry Pi. I decided to use Electron as it offers the key feature I need: Combining a web based UI with direct system an I/O access via node.js.
However, Electron refuses to run on my Raspberry Pi whereas it works just fine on the computer I am using for development. Nothing happens after issuing
electron .
in the terminal, the program just exits without showing a window or any errors in the command line. Any clues? I couldn't find any on the web so far. I installed Electron vianpm install electron-prebuilt -g
, which downloaded and installed the latest ARM-version.If this is an unresolvable compatibility problem: Are there any good alternatives for Electron?
Thanks in advance!
-
stoeffn over 8 years
electron --debug-brk=5858 .
produces no output as well. But I don't think it has to du with my app due to its simplicity (Just opens a window with a basic angular js app at the moment). Thanks for your help! -
skeggse over 8 yearsI don't think that's right - that issue is closed, and if you follow the issue chain you find #2094 which indicates that they cross-compile for ARM. It's entirely possible that their ARM cross-compile is incompatible with RPi, in which case (as @user650881 noted), you should compile from source.
-
emc almost 8 yearsBuild Electron, directly on an rPi?
Prerequisites: At least 25GB disk space and 8GB RAM.
-
Rip3rs about 6 yearsthe problem is this part: export DISPLAY=:0 thanks mate :)