Search code examples
raspberry-pielectronraspberry-pi3raspbian

Can't use an Electron built app on Rasbian


I'm working on an Electron project, and I wanted to run it on my raspberry pi 3 B+, which is on Raspbian (installed with NOOBS). I first tried to build my electron app with the following command, and then import it on my rasp through ssh.

npm run electron:linux

The app runs on my computer just fine, but it doesn't launch on my raspberry. I then tried to just git clone my whole project directly on it, but again, I didn't succeed to make it work. Does anyone know why it doesn't work on Raspbian ?


Solution

  • Okay, I found the issue by myself.

    On my computer, I was building my app with the following command:

    npm run build:prod && electron-builder build --linux (aka npm run electron:linux)

    But this won't work on raspbian as it works differently. To build correctly my electron app for a raspberry pi, I needed to use this following command instead, with the option --armv7:

    npm run build:prod && electron-builder build --linux --armv7

    I hope this answer will help some of you in the future !