• 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.

electron-rebuild and MagicMirror v2.18 (and more)

Scheduled Pinned Locked Moved Development
40 Posts 16 Posters 19.6k Views 21 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.
  • B Offline
    bugsounet Banned @wishmaster270
    last edited by Jan 5, 2022, 6:21 PM

    @wishmaster270 :

    If it can help, it’s perfect ;)
    I have do the same too for rebuild modules

    but don’t forget to delete "electron-rebuild": "v.xxx", from for package.json file ;)
    because this old package is not needed now

    @bugsounet

    1 Reply Last reply Reply Quote 0
    • B Offline
      bugsounet Banned @hedmik
      last edited by Jan 5, 2022, 6:24 PM

      @hedmik : i just share (one of) my own library ;)

      1 Reply Last reply Reply Quote 0
      • C Offline
        cyber152 @bugsounet
        last edited by Jan 5, 2022, 9:39 PM

        @bugsounet thank you very much, for weeks I am looking for a solution to finally be able to add an essential function to the mirror :thumbs_up:

        1 Reply Last reply Reply Quote 0
        • G Offline
          gonzonia @bugsounet
          last edited by Jan 5, 2022, 10:03 PM

          @bugsounet THANK YOU! This saved me a lot of headaches. I went ahead and updated to 2.18 and got the exact error you reference in the exact same module. A quick search and I found your very helpful solution. Thank you for sharing.

          1 Reply Last reply Reply Quote 0
          • L Offline
            lhops
            last edited by Jan 9, 2022, 10:32 PM

            I get an error when " ~/node_modules $ ~/.bin/MagicMirror-rebuild"
            error=(an unhandled error occurred inside electron-rebuild)
            unable to find electron’s version number of MagicMirror etc

            L B 2 Replies Last reply Jan 9, 2022, 10:42 PM Reply Quote 0
            • L Offline
              lhops @lhops
              last edited by Jan 9, 2022, 10:42 PM

              @lhops
              Can or has anyone written code for an new MMM-PIR-Sensor module that will work will the new version of MagicMirror. If not is that something that your can do? I wish I knew more about the code I would do it myself.

              1 Reply Last reply Reply Quote 0
              • B Offline
                bugsounet Banned @lhops
                last edited by Jan 9, 2022, 10:46 PM

                @lhops said in electron-rebuild and MagicMirror v2.18 (and more):

                I get an error when " ~/node_modules $ ~/.bin/MagicMirror-rebuild"

                execute ./node_modules/.bin/MagicMirror-rebuild INSIDE the module directory ;)

                not inside other directory ;)
                Note :

                1. every module in MagicMirror is there:
                cd ~/MagicMirror/modules
                
                1. After change again the directory to your wanted module,
                  for MMM-PIR-Sensor module (for example):
                cd MMM-PIR-Sensor
                
                1. after install magicmirror-rebuild
                npm i magicmirror-rebuild
                
                1. execute MagicMirror-rebuild program
                ./node_modules/.bin/MagicMirror-rebuild
                
                1. you will see MagicMirror Rebuild Complete

                2. it’s done ;)

                L 1 Reply Last reply Jan 10, 2022, 2:51 PM Reply Quote 0
                • L Offline
                  lhops @bugsounet
                  last edited by Jan 10, 2022, 2:51 PM

                  @bugsounet
                  This is the results of the instructions:

                  pi@raspberrypi:~/MagicMirror/modules/MMM-PIR-Sensor $ npm i magicmirror-rebuild
                  npm ERR! code EJSONPARSE
                  npm ERR! path /home/pi/MagicMirror/modules/MMM-PIR-Sensor/package.json
                  npm ERR! JSON.parse Unexpected string in JSON at position 803 while parsing ‘{
                  npm ERR! JSON.parse “name”: "Magic-Mirror-Module-PIR-Sen’
                  npm ERR! JSON.parse Failed to parse JSON data.
                  npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.

                  npm ERR! A complete log of this run can be found in:
                  npm ERR! /home/pi/.npm/_logs/2022-01-10T14_40_47_069Z-debug-0.log

                  I am sure you can look at this and see my problem.
                  Thank you for all your help!

                  B 1 Reply Last reply Jan 10, 2022, 4:12 PM Reply Quote 0
                  • B Offline
                    bugsounet Banned @lhops
                    last edited by bugsounet Jan 10, 2022, 4:19 PM Jan 10, 2022, 4:12 PM

                    @lhops said in electron-rebuild and MagicMirror v2.18 (and more):

                    npm ERR! JSON.parse “name”: "Magic-Mirror-Module-PIR-Sen’

                    If you have modified the “package.json” file … and you do not respect the syntax.
                    here is the result ;)
                    (Info: it is not like this that we rename a module)

                    to correct your issue try this:

                    cd ~/MagicMirror/modules/MMM-PIR-Sensor
                    rm -rf node_modules package-lock.json
                    git reset --hard HEAD
                    npm install magicmirror-rebuild --save
                    npm remove electron-rebuild
                    npm install
                    

                    (Sometime, i’m very kind… So kind for me)

                    @bugsounet

                    L 1 Reply Last reply Jan 10, 2022, 4:40 PM Reply Quote 0
                    • L Offline
                      lhops @bugsounet
                      last edited by Jan 10, 2022, 4:40 PM

                      @bugsounet
                      That did the trick. How can I thank you. It is working like it should!!

                      B 1 Reply Last reply Jan 10, 2022, 6:22 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 1 / 4
                      1 / 4
                      • First post
                        8/40
                        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