Read the statement by Michael Teeuw here.
Electron Error
-
I just did a fresh install of Magic Mirror which I’ve had running for years on a different RPi but for some reason I can’t seem to get this new version to start up due to Electron.
I have removed the electron folder and done an npm install that didn’t work, I removed the entire modules folder and did an npm install and that didn’t work… I’ve gone in and manually installed electron node node_modules/electron/install.js and I’m still getting this when I start up my magic mirror.
$ npm start
magicmirror@2.36.0 start
node --run start:wayland/home/Dashboard/MagicMirror/node_modules/electron/index.js:17
throw new Error(
^Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at getElectronPath (/home/Dashboard/MagicMirror/node_modules/electron/index.js:17:11)
at Object. (/home/Dashboard/MagicMirror/node_modules/electron/index.js:23:18)
at Module._compile (node:internal/modules/cjs/loader:1854:14)
at Object…js (node:internal/modules/cjs/loader:1985:10)
at Module.load (node:internal/modules/cjs/loader:1577:32)
at Module._load (node:internal/modules/cjs/loader:1379:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.require (node:internal/modules/cjs/loader:1600:12)
at require (node:internal/modules/helpers:153:16)
at Object. (/home/Dashboard/MagicMirror/node_modules/electron/cli.js:5:18)Node.js v24.16.0
-
@nobbie35 ok, you are using nvm
nvm install 22.22.1 nvm use 22.22.1 hash -r node -vif 22.22.1
cd ~/MagicMirror rm -rf node_modules npm run install-mmif successful
npm run start:waylandadvise results
-
@nobbie35 lets start back a step
open a terminal windowcd ~/MagicMirror rm -rf node_modules/electron npm install electron@41.3.0what is the result of that?
show the terminal output
this is what I seenpm install electron@41.3.0 added 1 package in 3s 240 packages are looking for funding run `npm fund` for details npm notice npm notice New major version of npm available! 10.9.4 -> 11.16.0 npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.16.0 npm notice To update run: npm install -g npm@11.16.0 npm noticeI am on node 22.22.1
you are on node 24maybe try node 22…
sudo npm install n -g sudo n 22.22.1 hash -r node -v cd ~/MagicMirror rm -rf node_modules npm run install-mmif you have wayland as window manager do
npm run start:waylandelse do
npm run start:x11if you don’t know, run this command stream (from my mm.sh in the scripted install at https://github.com/sdetweil/MagicMirror_scripts)
ps -ef | grep -v grep | grep -i -e xway -e labwc | wc -lif it returns 1, its wayland, otherwise x11
please advise results along the way… don’t try other things than this
-
Ok here’s what I got…
npm install electron@41.3.0 added 488 packages in 30s 246 packages are looking for funding run `npm fund` for detailsAfter running installing that and then trying to start MM it still gave me the same error
I ran the following
/Dashboard/MagicMirror $ sudo n 22.22.1 copying : node/22.22.1 installed : v22.22.1 (with npm 10.9.4) /Dashboard/MagicMirror $ hash -r /Dashboard/MagicMirror $ node -v v24.16.0Still got the same error and it says im running node 24 still running
Output of the commands
/Dashboard/MagicMirror $ ps -ef | grep -v grep | grep -i -e xway -e labwc | wc -l 2 -
@nobbie35 ok, node problem…
do
which nodeit will give you the path to the node executable
using n, it should bewhich node /usr/local/bin/node -
@sdetweil I agree with its a node problem.
~/Dashboard/MagicMirror $ which node
/home/pi/.nvm/versions/node/v24.16.0/bin/node -
@nobbie35 ok, you are using nvm
nvm install 22.22.1 nvm use 22.22.1 hash -r node -vif 22.22.1
cd ~/MagicMirror rm -rf node_modules npm run install-mmif successful
npm run start:waylandadvise results
-
Ok this fixed this issues… I’m not using wayland its still x11 i know that… I just have to go update my config file and main.css to match what I had in my previous implementation.
Thank you for the assist. Much appreciated
-
ps -ef | grep -v grep | grep -i -e xway -e labwccan you show its output
note we moved (user controlled files) like css to the config folder
IF you used my installer script, it would have moved everything other than the MM owned css contentsplease don’t edit main.css
all USER css goes in custom.css
that way when we install updates, we dont overwrite your stuff… -
S sdetweil has marked this topic as solved
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login