Clean installation... fails left and right
I’m seeing issues with the newest “Raspbian Stretch with desktop image” (Nov 2018–non-bloatware) as well – I did a fresh, manual installation, no errors, but electron will not start with the OpenGL driver (full KMS or fake KMS) enabled.
Confirming what I confirmed in the issue on GitHub just so others aren’t misled… Upgrading to Electron v3.0.13 is working fine (this is now the version installed if you use the develop branch of MM). V2.x is not working on the new Raspbian because of the OpenGL driver and we can’t use V4.x yet because of bad dependency references.
dazza120 last edited by
@shbatm how do I find out what version of electron I have, I’m on the latest version of Magic Mirror and would love to update everything on that side
cat ~/MagicMirror/node_modules/electron/package.json | grep '"version":'
cd ~/MagicMirror/ npm install firstname.lastname@example.org
devinhedge last edited by
for the last couple months Node.js and npm are currently BROKEN on RaspberryPi.
What version of node are you using and how are you trying to install it?
Current from default Rasbian repos.
Node.Js works fine with Raspberry Pi, just don’t install it from the default repos.
That may be the problem.
Use these instructions:
I’ve installed both v8 and v10 successfully multiple times on new Pis in the last few months.
I’ll give it a whirl. I was able to recreate the error 4 times so I just need to copy over the steps to recreate. I don’t have a lot of time to spend on it today.
dazza120 last edited by dazza120
cat ~/MagicMirror/node_modules/electron/package.json | grep ‘“version”:’
Thanks appears I was running electron 2.0.16 3.0.13 installed fixed a few vulnerabilities and all seems to be working fine on the Pi3B+
devinhedge last edited by
Instructions for Installing MagicMirror on Rasbian Stretch Lite
Install base Rasbian Stretch Lite image
Update base installation
- Update pi password
- Update Timezone
- Update Keyboard
- Update hostname
- Update Localization (language)
- Update WiFi configuration
- Expand file system and reboot
- Enable ssh
- Update System
sudo apt-get update && sudo apt upgrade -y && sudo apt-get dist-upgrade
Install Xserver, LXDE-gui, lightdm and other nescessary things:
sudo apt-get install raspberrypi-ui-mods firefox-esr build-essentials git -y
Use raspi-config to autologin pi user to gui at boot
Install Node.js from source
Remove Chris Lea’s Node.js if it has accidently been installed
sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-.list
sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-.list.save
Add the NodeSource package signing key
curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
Add the desired NodeSource repository
DISTRO="$(lsb_release -s -c)"
echo “deb https://deb.nodesource.com/$VERSION $DISTRO main” | sudo tee /etc/apt/sources.list.d/nodesource.list
echo “deb-src https://deb.nodesource.com/$VERSION $DISTRO main” | sudo tee -a /etc/apt/sources.list.d/nodesource.list
Test if the installation is good.
curl -sL https://deb.nodesource.com/test | bash -
(node:15418) TimeoutOverflowWarning: 4294967296000 does not fit into a 32-bit signed integer.
Timer duration was truncated to 2147483647.
(node:15418) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Install the Sample Node.js Electron app
npm install --save-dev electron
Git clone the sample app
Then install it and run
0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ] 2 info using email@example.com 3 info using firstname.lastname@example.org 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle email@example.com~prestart: firstname.lastname@example.org 6 info lifecycle email@example.com~start: firstname.lastname@example.org 7 verbose lifecycle email@example.com~start: unsafe-perm in lifecycle true 8 verbose lifecycle firstname.lastname@example.org~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/electron-quick-start/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games 9 verbose lifecycle email@example.com~start: CWD: /home/pi/electron-quick-start 10 silly lifecycle firstname.lastname@example.org~start: Args: [ '-c', 'electron .' ] 11 silly lifecycle email@example.com~start: Returned: code: 1 signal: null 12 info lifecycle firstname.lastname@example.org~start: Failed to exec start script 13 verbose stack Error: email@example.com start: `electron .` 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16) 13 verbose stack at EventEmitter.emit (events.js:182:13) 13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:182:13) 13 verbose stack at maybeClose (internal/child_process.js:962:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) 14 verbose pkgid firstname.lastname@example.org 15 verbose cwd /home/pi/electron-quick-start 16 verbose Linux 4.14.79-v7+ 17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" 18 verbose node v10.15.0 19 verbose npm v6.4.1 20 error code ELIFECYCLE 21 error errno 1 22 error email@example.com start: `electron .` 22 error Exit status 1 23 error Failed at the firstname.lastname@example.org start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]
I’m beginning to think about the quote:
Insanity: doing the same thing over and over again and expecting different results.
Install Node.js from source
The Nodesource install scripts will save you some time/steps:
curl -sL https://deb.nodesource.com/setup_10.x | bash - apt-get install -y nodejs
It looks like everything installed correctly. As has been said before:
As others have said, most of your problems are because you use Raspbian Lite.
The electron-quick-start app tries to install electron v4.0, which as I said above, does not work on the latest version of Raspbian–you need to use v3.0.13 (
npm i email@example.com).
Also, are you trying to run electron from the Pi’s desktop or SSH? If you’re running it from SSH you need to run it with
DISPLAY=:0 npm start