Read the statement by Michael Teeuw here.
MMM-ModuleToggleButton suddenly broken?
-
@philie ok, two things…
1 lets fix the epoll problem.
it seems that was installed accidentally in the wrong place as its outside the MagicMirror folder/home/philie/node_modules/epoll
do
cd ~ rm -rf node_modules/epoll
2 use my fork of the MMM-ModuleToggleButton module which fixes the install
https://github.com/sdetweil/MMM-ModuleToggleButtonremove the old module folder, clone my fork and npm install it
cd ~/MagicMirror/modules rm -rf MMM-ModuleToggleButton git clone https://github.com/sdetweil/MMM-ModuleToggleButton cd MMM-ModuleToggleButton npm install
let me know
-
@sdetweil
Great! Module ist now installed fine and the test-confg (just the toggle module and another one to toggle activated) is working!Very much appreciated what you are doing for this community! Thank you!
-
@philie awesome!!!
-
@sdetweil said in MMM-ModuleToggleButton suddenly broken?:
cd MMM-ModuleToggleButton
Hey there, it’s me again with the same problem…
I did the MM Update to 2.28.0 by Script. Like usually some things are broken after and I did npm install and npm rebuild in the MM rootdirectory. It installed some stuff and looked good so far.
But the module MMM-ModuleToggleButton stays broken like after every update.
It has again something to do with electron, I tried to reinstall electron, but have no success…The output:
philie@magicmirror:~/MagicMirror/modules $ git clone https://github.com/sdetweil/MMM-ModuleToggleButton Cloning into 'MMM-ModuleToggleButton'... remote: Enumerating objects: 44, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (4/4), done. remote: Total 44 (delta 0), reused 2 (delta 0), pack-reused 40 Receiving objects: 100% (44/44), 10.44 KiB | 1.30 MiB/s, done. Resolving deltas: 100% (17/17), done. philie@magicmirror:~/MagicMirror/modules $ cd MMM-ModuleToggleButton philie@magicmirror:~/MagicMirror/modules/MMM-ModuleToggleButton $ npm install > MMM-ModuleToggleButton@1.0.0 postinstall > ./postinstall /home/philie/MagicMirror/modules/MMM-ModuleToggleButton ./postinstall: line 8: ../../node_modules/.bin/electron-rebuild: No such file or directory npm error code 127 npm error path /home/philie/MagicMirror/modules/MMM-ModuleToggleButton npm error command failed npm error command sh -c ./postinstall npm error A complete log of this run can be found in: /home/philie/.npm/_logs/2024-07-14T11_29_32_616Z-debug-0.log philie@magicmirror:~/MagicMirror/modules/MMM-ModuleToggleButton $
so, electron-rebuild in node_modules seems to be missing…
Indeed:
philie@magicmirror:~/MagicMirror/node_modules $ cd electron philie@magicmirror:~/MagicMirror/node_modules/electron $ ll total 1068 drwxr-xr-x 4 root root 4096 Jul 14 13:20 . drwxr-xr-x 679 philie philie 28672 Jul 14 13:10 .. -rw-r--r-- 1 root root 8126 Jul 14 12:46 checksums.json -rwxr-xr-x 1 root root 612 Jul 14 12:46 cli.js drwxr-xr-x 4 root root 4096 Jul 14 12:48 dist -rw-r--r-- 1 root root 972754 Jul 14 12:46 electron.d.ts -rw-r--r-- 1 root root 659 Jul 14 12:46 index.js -rw-r--r-- 1 root root 3178 Jul 14 12:46 install.js -rw-r--r-- 1 root root 1096 Jul 14 12:46 LICENSE drwxr-xr-x 70 root root 4096 Jul 14 13:20 node_modules -rw-r--r-- 1 root root 586 Jul 14 12:46 package.json -rw-r--r-- 1 root root 31409 Jul 14 13:20 package-lock.json -rw-r--r-- 1 root root 8 Jul 14 12:48 path.txt -rw-r--r-- 1 root root 5370 Jul 14 12:46 README.md
I did already the steps from last time (therefore I answer in this old topic) but no luck this time.
What can I do?Thank you,
philie -
@philie can you dump out the postinstall
file in the module folder…
it seems to be missing a step -
@philie I see the postinstall script needed an update
do a
git pull
in the module folder
then
npm install again -
@sdetweil
Thank you Sam!
the edited script did not work for me but the commands worked. so I executed them manually:philie@magicmirror:~/MagicMirror $ sudo npm install @electron/rebuild added 88 packages, and removed 74 packages in 25s 220 packages are looking for funding run `npm fund` for details philie@magicmirror:~/MagicMirror $ node_modules/.bin/electron-rebuild ✔ Rebuild Complete philie@magicmirror:~/MagicMirror $
unfortunately the next issue is already on the dorstep:
message:14:59:24.366] [31m[ERROR][39m [31m(node:2306) UnhandledPromiseRejectionWarning: Error: The module '/home/philie/MagicMirror/modules/MMM-ModuleToggleButton/node_modules/epoll/build/Release/epoll.node'[39m,
So it looks like the thing about epoll is not yet solved…
-
@philie never use sudo…
the electron-rebuild command has to be done from inside the module folder(togglebuttons), not the MagicMirror folder
-
@sdetweil
Thank you very much! This did the trick. concerning sudo… it’s sometimes confusing because often I get the message, I do not have enough rights for some commands… -
@philie in general for MM there is NEVER a need for sudo… it will cause problems and LATER you will need to user sudo AGAIN…
the SYSTEM commands may need to use sudo…
apt update, upgrade, editing files in the /etc folder
because THOSE are owned by the system and should NOT be editable by a user
(they are protected on purpose)the fact that the postinstall script failed is probably because you did sudo before and now the npm files are owned by root instead of user… (see line 1 above)