• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

MMM-ModuleToggleButton suddenly broken?

Scheduled Pinned Locked Moved Solved Troubleshooting
15 Posts 2 Posters 694 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Away
    sdetweil @philie
    last edited by Feb 15, 2024, 2:14 PM

    @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-ModuleToggleButton

    remove 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

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    P 1 Reply Last reply Feb 15, 2024, 3:53 PM Reply Quote 0
    • P Offline
      philie @sdetweil
      last edited by Feb 15, 2024, 3:53 PM

      @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!

      S 1 Reply Last reply Feb 15, 2024, 3:56 PM Reply Quote 1
      • S Away
        sdetweil @philie
        last edited by Feb 15, 2024, 3:56 PM

        @philie awesome!!!

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • P Offline
          philie
          last edited by Jul 14, 2024, 11:36 AM

          @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

          S 1 Reply Last reply Jul 14, 2024, 11:42 AM Reply Quote 0
          • S Away
            sdetweil @philie
            last edited by Jul 14, 2024, 11:42 AM

            @philie can you dump out the postinstall
            file in the module folder…
            it seems to be missing a step

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            S 1 Reply Last reply Jul 14, 2024, 11:48 AM Reply Quote 0
            • S Away
              sdetweil @sdetweil
              last edited by Jul 14, 2024, 11:48 AM

              @philie I see the postinstall script needed an update

              do a
              git pull
              in the module folder
              then
              npm install again

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              P 1 Reply Last reply Jul 14, 2024, 1:46 PM Reply Quote 0
              • P Offline
                philie @sdetweil
                last edited by Jul 14, 2024, 1:46 PM

                @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] [ERROR] (node:2306) UnhandledPromiseRejectionWarning: Error: The module '/home/philie/MagicMirror/modules/MMM-ModuleToggleButton/node_modules/epoll/build/Release/epoll.node',
                

                So it looks like the thing about epoll is not yet solved…

                S 1 Reply Last reply Jul 14, 2024, 1:53 PM Reply Quote 0
                • S Away
                  sdetweil @philie
                  last edited by Jul 14, 2024, 1:53 PM

                  @philie never use sudo…

                  the electron-rebuild command has to be done from inside the module folder(togglebuttons), not the MagicMirror folder

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  P 1 Reply Last reply Jul 14, 2024, 3:14 PM Reply Quote 0
                  • P Offline
                    philie @sdetweil
                    last edited by Jul 14, 2024, 3:14 PM

                    @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…

                    S 1 Reply Last reply Jul 14, 2024, 3:28 PM Reply Quote 0
                    • S Away
                      sdetweil @philie
                      last edited by Jul 14, 2024, 3:28 PM

                      @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)

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 1
                      • 1
                      • 2
                      • 1 / 2
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy