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.

    Magic Mirror and NodeJS

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    9 Posts 3 Posters 1.6k Views 3 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.
    • C Offline
      cldparisi
      last edited by

      I have MagicMirror installed on a Raspberry Pi 3, a few days ago I needed to install mqtt because I need it for an integration that I want to implement on one of the modules.

      When I tried to install it it gave some errors, from what we understood it was due to a version of NodeJS that was too old, at that point I installed a more recent version and set it as nodejs by default, Magic Mirror started but if I put a referring to mqtt it gave me an error at the end of everything I found myself having 4 versions of nodejs installed on the Raspberry installed via nvm:
      14.21.3
      16.20.2
      20.10.0
      21.4.0

      But the problem still remained, doing various searches on the internet I read that often even if one version is set by default to be used by the various nodejs applications then another one is used and to be sure to verify by putting a log inside the application :
      console.log(process.version);

      The result was surprising: v12.13.0

      Which is not among the versions installed via nvm, evidently 2/3 years ago when I created the MagicMirror I had installed nodejs in another way, honestly I don’t remember how I did it and what but the fact is that I can’t find the version it uses on the Raspberry by launching nvm ls.

      At this point I’m wondering how I could set MagicMirror so that it uses one of the other 4 versions installed with nvm or alternatively how I can update the “ghost” version that I can’t find

      Thank you

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @cldparisi
        last edited by

        @cldparisi the latest mm needs node v18 or up. as we have moved to to built in version of fetch, instead of the add on libraries

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @sdetweil
          last edited by

          @sdetweil if you use my upgrade script I will upgrade nodejs too

          https://github.com/sdetweil/MagicMirror_scripts

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          R 1 Reply Last reply Reply Quote 0
          • R Offline
            reilley @sdetweil
            last edited by

            @sdetweil - Sam, will your scripts install Nodejs and NPM? My SSD died and I’m having a hell of a time getting Nodejs installed on it. I keep getting errors about glibcc_3.4.29 and 3.4.30 not being found.

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @reilley
              last edited by sdetweil

              @reilley Yes, my script does everything you need to get running… BUT… it sounds like you are on buster (lsb_release -a)… and the latest nodejs doesn’t run on buster… SO

              anyhow, look at my backup/restore scripts… makes backup of config.js, custom.css, all the links of the installed modules (where they came from) and any extra files created by the modules, token files, credentials…

              then after reinstall mm… run restore to put back all that
              https://github.com/sdetweil/MagicMirror-backup-restore

              the backup is very small… 3 files of text, and maybe a few token files also text

              can also save the repo in git, and restore/install from there
              and provides ability to version backup… so you could restore to a different version…

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              R 1 Reply Last reply Reply Quote 0
              • R Offline
                reilley @sdetweil
                last edited by

                @sdetweil - I’ve been running on Bullseye up until until the SSD croaked. I just installed Bookworm 64 bit before I saw your reply and once it’s done updating, I’ll give your script a whirl. Weird that this was happening since I installed NodeJS with no problems a few months ago. Argh!!!

                Thanks for the help as always!!!

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @reilley
                  last edited by

                  @reilley the parts keep moving UP the currency chain… we need a lib, it needs 20.9, now need another lib, it needs 20.18.1, new electron, … the new nodejs versions need a new c++runtime lib… oops its not available on older OS… armv6l is really getting long in the tooth… (20.18.1 is the last version available …)

                  latest nodejs is 23… we checked and didn’t accept that… fixed on jan 1… but its hard to keep up…

                  can’t sit still

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  R 1 Reply Last reply Reply Quote 0
                  • R Offline
                    reilley @sdetweil
                    last edited by

                    @sdetweil - I feel ya! Back from dinner with the wife and your script ran perfectly - thanks! Now, I’m tracking down a pesky weather module issue, grrrrr. I’ll definitely be taking advantage of your backup scripts as soon as I get this all working again. I don’t ever want to reinstall from scratch again, ugh.

                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      sdetweil @reilley
                      last edited by

                      @reilley said in Magic Mirror and NodeJS:

                      I’ll definitely be taking advantage of your backup scripts as soon as I get this all working again

                      note you can backup, and backup and backup and backup, over and over…

                      and each one has a git tag… and you can restore THAT version…

                      so, backup as much as you want, add a message on each so you know what you did in this version
                      (added weather, changed colors… whatever, in quotes)

                      the list_tags command link will list them out

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 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