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

module not found error loading module in MagicMirror

Scheduled Pinned Locked Moved Solved Troubleshooting
41 Posts 12 Posters 31.9k Views 14 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.
  • L Offline
    LMAC
    last edited by Jan 4, 2022, 12:28 AM

    I ran the command as recommended (request was my error as well). I now have this error and MM will not load:

    A JavaScript error occurred in the main process
    Uncaught Exception:
    Error: Cannot find module ‘logger’
    Require stack:

    • /home/pi/MagicMirror/js/app.js
    • /home/pi/MagicMirror/js/electron.js
    • /home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js
    • at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
      at Function.n._resolveFilename (node:electron/js2c/browser_init:249:1128)
      at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29)
      at Module._load (node:internal/modules/cjs/loader:785:27)
      at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
      at Module.require (node:internal/modules/cjs/loader:1012:19)
      at require (node:internal/modules/cjs/helpers:94:18)
      at Object. (/home/pi/MagicMirror/js/app.js:13:13)
      at Module._compile (node:internal/modules/cjs/loader:1116:14)
      at Object.Module._extensions…js (node:internal/modules/cjs/loader:1169:10)
    S 1 Reply Last reply Jan 4, 2022, 12:45 AM Reply Quote 0
    • S Offline
      sdetweil @LMAC
      last edited by Jan 4, 2022, 12:45 AM

      @lmac well you ran it in the wrong place… oops

      do this

      cd ~/MagicMirror
      rm -rf node_modules
      rm package-lock.json
      npm install
      

      then for whatever module was causing problem

      cd ~/MagicMirror/modules/modulename
      

      do the same last 3 steps as above
      AND THEN

      npm install request --save
      

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 1
      • D Offline
        DarrenHill
        last edited by Jan 9, 2022, 1:46 PM

        Just wanted to say thanks for the fix here.

        Did an update and hit exactly this with MMM-GmailFeed and the request module.

        Installed it back (with an audit fix afterwards) and now all up and running again :)

        S 1 Reply Last reply Jan 9, 2022, 2:10 PM Reply Quote 0
        • S Offline
          sdetweil @DarrenHill
          last edited by Jan 9, 2022, 2:10 PM

          @darrenhill said in fix for black screen in 2.16 and later:

          with an audit fix afterwards

          don’t do those… many times leave more trouble than they fix…
          we can’t suppress the audit warning message

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          D 1 Reply Last reply Jan 9, 2022, 2:44 PM Reply Quote 0
          • D Offline
            DarrenHill @sdetweil
            last edited by Jan 9, 2022, 2:44 PM

            @sdetweil OK, thanks for the pointer.

            Always kinda worried when that style of message pops up, for security and suchlike.

            I see from the update that my node is very much out of date, so now just backing things up before setting the update script onto it to try and bring that up too.

            S 1 Reply Last reply Jan 9, 2022, 3:38 PM Reply Quote 0
            • S Offline
              sdetweil @DarrenHill
              last edited by Jan 9, 2022, 3:38 PM

              @darrenhill upgrade is for MM, not node, (altho it might do it, works sometimes, need to move to n) …

              easiest is using the node version of nvm, called n

              do

              sudo npm i n -g
              PATH="$PATH"
              n 16 
              

              then node 16 will be installed…

              note that you will have to do another npm install in the mm (and maybe module folders)
              this the upgrade would do (with force instead of apply)

              n also allows you to SWITCH versions, or use a particular version for ONE app…
              see n --help

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              D 1 Reply Last reply Jan 9, 2022, 9:39 PM Reply Quote 0
              • D Offline
                DarrenHill @sdetweil
                last edited by DarrenHill Jan 9, 2022, 9:41 PM Jan 9, 2022, 9:39 PM

                @sdetweil - I did it via your update script, and it has updated Node from v10.x to v16.x (or at least that is what appears to have happened from what I could read).

                It’s quite an old install that just sits on my desk and largely gets left to its own devices. It is in a PiTop Ceed rather than a true mirror, and basically the only thing it runs is MM (it’s actually a dual-boot via PINN also with RetroPie, but the Raspi OS partition is essentially only MM). So no need to keep things focussed to one app or anything like that - no issue of cross-contamination.

                All is working fine after the update though, so no problems.

                S 1 Reply Last reply Jan 9, 2022, 9:43 PM Reply Quote 0
                • S Offline
                  sdetweil @DarrenHill
                  last edited by Jan 9, 2022, 9:43 PM

                  @darrenhill cool. thx for the feedback

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  N 1 Reply Last reply Jan 30, 2022, 7:30 PM Reply Quote 0
                  • N Offline
                    np27np27 @sdetweil
                    last edited by Jan 30, 2022, 7:30 PM

                    @sdetweil
                    Ran your update script today and now got black screen. Should I still check each module for json files and npm install or will the script have done that already?
                    How to I go about trying to troubleshoot this ? Any help is much appreciated!

                    S 1 Reply Last reply Jan 30, 2022, 8:28 PM Reply Quote 0
                    • S Offline
                      sdetweil @np27np27
                      last edited by sdetweil Jan 31, 2022, 2:31 AM Jan 30, 2022, 8:28 PM

                      @np27np27 want to see installers/upgrade.log

                      same process as listed in post 1

                      ‘request’ is NOT the only library missing

                      the messages tell you what needs to be added

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      N 1 Reply Last reply Jan 31, 2022, 10:31 AM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 3 / 5
                      • 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