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.

    Node.js Compile Version Mis-Matches?

    Scheduled Pinned Locked Moved Troubleshooting
    15 Posts 4 Posters 3.9k Views 4 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.
    • P Offline
      pillbug22
      last edited by pillbug22

      I’m trying to MMM-MP3Player up and running to play music locally.

      Following the install instructions on GitHub, I added the 3 dependencies listed, then cloned the MMM-MP3Player project down as instructed.

      Now when starting up the MagicMirror, I’m getting the following:

      [2020-06-03 09:44:27.792] [LOG]    Whoops! There was an uncaught exception...
      [2020-06-03 09:44:27.793] [ERROR]  Error: The module '/home/pi/MagicMirror/modules/MMM-MP3Player/node_modules/usb/build/Release/usb_bindings.node'
      was compiled against a different Node.js version using
      NODE_MODULE_VERSION 64. This version of Node.js requires
      NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
      the module (for instance, using `npm rebuild` or `npm install`).
          at process.func (electron/js2c/asar.js:138:31)
          at process.func [as dlopen] (electron/js2c/asar.js:138:31)
          at Object.Module._extensions..node (internal/modules/cjs/loader.js:828:18)
          at Object.func (electron/js2c/asar.js:138:31)
          at Object.func [as .node] (electron/js2c/asar.js:138:31)
          at Module.load (internal/modules/cjs/loader.js:645:32)
          at Function.Module._load (internal/modules/cjs/loader.js:560:12)
          at Module.require (internal/modules/cjs/loader.js:685:19)
          at require (internal/modules/cjs/helpers.js:16:16)
          at bindings (/home/pi/MagicMirror/modules/MMM-MP3Player/node_modules/bindings/bindings.js:112:48)
      

      Based on a similar issue/troubleshooting I found, I have done:

      cd /MagicMirror/modules/MMM-MP3Player
      rm -rf node_modules/usb
      npm cache clear
      rm package-lock.json
      npm i
      

      It does some work to rebuild/install the MMM-MP3Player module again, but I still receive the same error when starting up the MagicMirror next time.

      I then tried the 2nd and 3rd highest proposed solutions on there (electron-rebuild and –update-binary, but wind up with same error each time when trying to launch the MagicMirror.

      I’m guessing there is a different file that needs to be rebuilt, or a way to force using a specific version of Node.js?

      S 1 Reply Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @pillbug22
        last edited by

        @pillbug22 do

        cd ~/MagicMirror
        npm install electron-rebuild
        node_modules/.bin/electron-rebuild
        

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • ? Offline
          A Former User
          last edited by

          @sdetweil : are you sure of this ?
          install and execute electron rebuild inside main MM core !?

          S 1 Reply Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @Guest
            last edited by

            @Bugsounet sure, it will find what it needs to rebuild

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • ? Offline
              A Former User
              last edited by

              and scan … ALL modules …

              S 1 Reply Last reply Reply Quote 0
              • S Do not disturb
                sdetweil @Guest
                last edited by

                @Bugsounet so, it will do it quickly… go get some coffee… everything not done in 2 seconds! lol

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • ? Offline
                  A Former User
                  last edited by A Former User

                  lol

                  so the better thing is that :
                  install electron rebuild inside the module desired (there MMM-MP3Player)

                  cd ~/MagicMirror/modules/MMM-MP3Player
                  npm install electron-rebuild
                  

                  and execute it

                  ./node_modules/.bin/electron-rebuild
                  
                  S 1 Reply Last reply Reply Quote 0
                  • S Do not disturb
                    sdetweil @Guest
                    last edited by

                    @Bugsounet better not to install it 12 times , just one in MM, then maybe use in module folder…

                    too many modules need rebuild

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    1 Reply Last reply Reply Quote 0
                    • ? Offline
                      A Former User
                      last edited by

                      I have already tried it but sometimes … it remakes the queue with the other modules and crashes … that’s why I abandoned this method. otherwise on principle i agree with you :)

                      after … like i say : “If it want to works like this … let’s go on !”

                      1 Reply Last reply Reply Quote 0
                      • ? Offline
                        A Former User
                        last edited by A Former User

                        I think MM needs to escape from the dependency of Electron. (Frankly, it is needed only for fullscreen kiosk front, not using any advanced benefits of Electron itself)
                        or at least modules need to use worker-threading or spawning child process which would be independent from Electron process environment to work with node’s native-modules.

                        S 1 Reply Last reply Reply Quote 0
                        • S Do not disturb
                          sdetweil @Guest
                          last edited by

                          @Sean yeh… could have used my prior startup script to test it out with chrome… start serveronly and use chrome to access

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          ? 1 Reply Last reply Reply Quote 0
                          • ? Offline
                            A Former User @sdetweil
                            last edited by

                            @sdetweil
                            I had used my owns for the same.
                            Currently, standalone MM executes server(backend) js inside of Electron. That makes the things complex.
                            It would have been better to execute server outside of MM then launch front Electron for a smooth fullscreen kiosk mode.

                            Or progressively using Electron’s features might have been better also. Electron can support more advanced features like accessing system resources directly.

                            Anyway, current structure is somewhat ambiguous. I was frightened.

                            S 1 Reply Last reply Reply Quote 0
                            • S Do not disturb
                              sdetweil @Guest
                              last edited by

                              @Sean yeh, just get my run-start.sh scripts from my repo (added to base in 2.10, yanked out in 2.11)

                              https://github.com/sdetweil/MagicMirror_scripts
                              change the start to launch run-start.sh

                              then can add a config parm to config.js

                              serverOnly:‘local’,

                              will do split mode locally serverOnly+ chrome

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

                              1 Reply Last reply Reply Quote 0
                              • P Offline
                                pillbug22
                                last edited by

                                I thought I’d already done an Electron-rebuild install from the previous troubleshooting listed, but of course I wanted to do it again to verify:

                                $ cd MagicMirror
                                $ cd modules
                                $ cd MMM-MP3Player
                                $ npm install electron-rebuild
                                npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
                                npm WARN MMM-MP3Player@1.0.0 No repository field.
                                
                                + electron-rebuild@1.11.0
                                updated 1 package and audited 204 packages in 17.328s
                                
                                1 package is looking for funding
                                  run `npm fund` for details
                                
                                found 0 vulnerabilities
                                
                                $ node_modules/.bin/electron-rebuild
                                ✔ Rebuild Complete
                                
                                

                                then go back up some folders and run:

                                $ npm run start
                                

                                …aaaaaand, it opens as expected. Absolutely no clue what was different this time around. I went back and looked, and looks like I did already do this as per previous troubleshooting I found, but there must have been something different about how you guys suggested I install and run the electron-rebuild than what I did previously.

                                Another one of those “just needed a different set of eyes on it” issues, but glad you all were here to be the ones to look :-) Thank you much!

                                Now to go play around some more and see if I can actually get it to work correctly…but at least the mirror is back up and running

                                1 Reply Last reply Reply Quote 0
                                • ? Offline
                                  A Former User
                                  last edited by

                                  @pillbug22 : happy to help you :)

                                  1 Reply Last reply Reply Quote 0

                                  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
                                  • 1 / 1
                                  • 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