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 Error

    Scheduled Pinned Locked Moved Solved Troubleshooting
    8 Posts 2 Posters 6 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.
    • N Offline
      nobbie35
      last edited by

      I just did a fresh install of Magic Mirror which I’ve had running for years on a different RPi but for some reason I can’t seem to get this new version to start up due to Electron.

      I have removed the electron folder and done an npm install that didn’t work, I removed the entire modules folder and did an npm install and that didn’t work… I’ve gone in and manually installed electron node node_modules/electron/install.js and I’m still getting this when I start up my magic mirror.

      $ npm start

      magicmirror@2.36.0 start
      node --run start:wayland

      /home/Dashboard/MagicMirror/node_modules/electron/index.js:17
      throw new Error(
      ^

      Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
      at getElectronPath (/home/Dashboard/MagicMirror/node_modules/electron/index.js:17:11)
      at Object. (/home/Dashboard/MagicMirror/node_modules/electron/index.js:23:18)
      at Module._compile (node:internal/modules/cjs/loader:1854:14)
      at Object…js (node:internal/modules/cjs/loader:1985:10)
      at Module.load (node:internal/modules/cjs/loader:1577:32)
      at Module._load (node:internal/modules/cjs/loader:1379:12)
      at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
      at Module.require (node:internal/modules/cjs/loader:1600:12)
      at require (node:internal/modules/helpers:153:16)
      at Object. (/home/Dashboard/MagicMirror/node_modules/electron/cli.js:5:18)

      Node.js v24.16.0

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

        @nobbie35 ok, you are using nvm

        nvm install 22.22.1
        nvm use 22.22.1
        hash -r
        node -v
        

        if 22.22.1

        cd ~/MagicMirror
        rm -rf node_modules
        npm run install-mm
        

        if successful

        npm run start:wayland
        

        advise results

        Sam

        How to add modules

        learning how to use browser developers window for css changes

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

          @nobbie35 lets start back a step
          open a terminal window

          cd ~/MagicMirror
          rm -rf node_modules/electron
          npm install electron@41.3.0
          

          what is the result of that?
          show the terminal output
          this is what I see

          npm install electron@41.3.0
          
          added 1 package in 3s
          
          240 packages are looking for funding
            run `npm fund` for details
          npm notice
          npm notice New major version of npm available! 10.9.4 -> 11.16.0
          npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.16.0
          npm notice To update run: npm install -g npm@11.16.0
          npm notice
          

          I am on node 22.22.1
          you are on node 24

          maybe try node 22…

          sudo npm install n -g
          sudo n 22.22.1
          hash -r
          node -v
          cd ~/MagicMirror
          rm -rf node_modules
          npm run install-mm
          

          if you have wayland as window manager do

          npm run start:wayland
          

          else do

          npm run start:x11
          

          if you don’t know, run this command stream (from my mm.sh in the scripted install at https://github.com/sdetweil/MagicMirror_scripts)

          ps -ef | grep -v grep | grep -i -e xway -e labwc | wc -l
          

          if it returns 1, its wayland, otherwise x11

          please advise results along the way… don’t try other things than this

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • N Offline
            nobbie35
            last edited by

            Ok here’s what I got…

            npm install electron@41.3.0
            
            added 488 packages in 30s
            
            246 packages are looking for funding
              run `npm fund` for details
            

            After running installing that and then trying to start MM it still gave me the same error

            I ran the following

            /Dashboard/MagicMirror $ sudo n 22.22.1
                 copying : node/22.22.1
               installed : v22.22.1 (with npm 10.9.4)
            /Dashboard/MagicMirror $ hash -r
            /Dashboard/MagicMirror $ node -v
            v24.16.0
            

            Still got the same error and it says im running node 24 still running

            Output of the commands

            /Dashboard/MagicMirror $ ps -ef | grep -v grep | grep -i -e xway -e labwc | wc -l
            2
            
            S 2 Replies Last reply Reply Quote 0
            • S Offline
              sdetweil @nobbie35
              last edited by

              @nobbie35 ok, node problem…

              do

              which node
              

              it will give you the path to the node executable
              using n, it should be

              which node
              /usr/local/bin/node
              

              Sam

              How to add modules

              learning how to use browser developers window for css changes

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

                @sdetweil I agree with its a node problem.

                ~/Dashboard/MagicMirror $ which node
                /home/pi/.nvm/versions/node/v24.16.0/bin/node

                S N 2 Replies Last reply Reply Quote 0
                • S Offline
                  sdetweil @nobbie35
                  last edited by

                  @nobbie35 ok, you are using nvm

                  nvm install 22.22.1
                  nvm use 22.22.1
                  hash -r
                  node -v
                  

                  if 22.22.1

                  cd ~/MagicMirror
                  rm -rf node_modules
                  npm run install-mm
                  

                  if successful

                  npm run start:wayland
                  

                  advise results

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • N Offline
                    nobbie35 @nobbie35
                    last edited by

                    Ok this fixed this issues… I’m not using wayland its still x11 i know that… I just have to go update my config file and main.css to match what I had in my previous implementation.

                    Thank you for the assist. Much appreciated

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

                      @nobbie35 said: node 22, awesome
                      hmmm this says wayland

                       ps -ef | grep -v grep | grep -i -e xway -e labwc 
                      

                      can you show its output

                      note we moved (user controlled files) like css to the config folder
                      IF you used my installer script, it would have moved everything other than the MM owned css contents

                      please don’t edit main.css

                      all USER css goes in custom.css
                      that way when we install updates, we dont overwrite your stuff…

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • S sdetweil has marked this topic as solved

                      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