Read the statement by Michael Teeuw here.
MM Ver.2.21 Electron failed to install error
-
I just updated to ver 2.21. MM crashed and no longer working. npm start shows error
magicmirror@2.21.0 start
DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js/home/pi/MagicMirror/node_modules/electron/index.js:17
throw new Error(‘Electron failed to install correctly, please delete node_modules/electron and try installing again’);
^Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at getElectronPath (/home/pi/MagicMirror/node_modules/electron/index.js:17:11)
at Object. (/home/pi/MagicMirror/node_modules/electron/index.js:21:18)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at Module.require (node:internal/modules/cjs/loader:1057:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object. (/home/pi/MagicMirror/node_modules/electron/cli.js:3:18)
at Module._compile (node:internal/modules/cjs/loader:1155:14)Please help in resolving issue. A step by step instructions would help. I dont want to reinstall MM all over again. Adding all modules and reconfiguring the config.js file is not an option.
Thanks. -
@Rags how did u update? manual git pull/npm install or my upgrade script?
can you show output of
uname -a
lsb_release -a
node -v
npm -vu ‘might’ have luck with
cd ~/MagicMirror npm install electron@19.1.0
report the results.
-
@Rags also if you use something like my backup/restore it could save you literally DAYS of work
see
https://github.com/sdetweil/MagicMirror-backup-restoreand my script repo, install/upgrade
-
@sdetweil
I did a git pull in MM directory.
However before that i had tried to install MMM-json-feed which failed during installation. I guess it must have messed up the electron somhow.
uname -a
Linux raspberrypi 5.10.103-v7+ #1529 SMP Tue Mar 8 12:21:37 GMT 2022 armv7l GNU/Linux
npm -v 9.1.2
node -v 16.8.1
when i do a npm install electron@19.1.0 i get
pi@raspberrypi:~/MagicMirror $ npm install electron@19.1.0
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /home/pi/MagicMirror/node_modules/ip6
npm ERR! dest /home/pi/MagicMirror/node_modules/.ip6-Ll8TJZWc
npm ERR! errno -39
npm ERR! ENOTEMPTY: directory not empty, rename ‘/home/pi/MagicMirror/node_modules/ip6’ -> ‘/home/pi/MagicMirror/node_modules/.ip6-Ll8TJZWc’npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2022-11-24T16_02_00_445Z-debug-0.log -
@Rags ok best to clean
do
cd ~/MagicMirror rm -rf node_modules rm package-lock.json npm install --omit=dev --no-audit --no-fund
-
@sdetweil
Bingo. All systems go…
Thanks once again.
I am doing the backup restore thing now.