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.

    cannot find module

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    10 Posts 2 Posters 1.2k 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.
    • T Offline
      theaddies
      last edited by

      Everything worked fine and I don’t think I did anything. Then I get the error below.

       pm2 status
      node:internal/modules/cjs/loader:1024
        throw err;
        ^
      
      Error: Cannot find module './ranges/ltr'
      Require stack:
      - /usr/lib/node_modules/pm2/node_modules/semver/index.js
      - /usr/lib/node_modules/pm2/lib/Common.js
      - /usr/lib/node_modules/pm2/lib/Client.js
      - /usr/lib/node_modules/pm2/lib/API.js
      - /usr/lib/node_modules/pm2/lib/binaries/CLI.js
      - /usr/lib/node_modules/pm2/bin/pm2
          at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1021:15)
          at Function.Module._load (node:internal/modules/cjs/loader:866:27)
          at Module.require (node:internal/modules/cjs/loader:1093:19)
          at require (node:internal/modules/cjs/helpers:108:18)
          at Object.<anonymous> (/usr/lib/node_modules/pm2/node_modules/semver/index.js:39:13)
          at Module._compile (node:internal/modules/cjs/loader:1191:14)
          at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
          at Module.load (node:internal/modules/cjs/loader:1069:32)
          at Function.Module._load (node:internal/modules/cjs/loader:904:12)
          at Module.require (node:internal/modules/cjs/loader:1093:19) {
        code: 'MODULE_NOT_FOUND',
        requireStack: [
          '/usr/lib/node_modules/pm2/node_modules/semver/index.js',
          '/usr/lib/node_modules/pm2/lib/Common.js',
          '/usr/lib/node_modules/pm2/lib/Client.js',
          '/usr/lib/node_modules/pm2/lib/API.js',
          '/usr/lib/node_modules/pm2/lib/binaries/CLI.js',
          '/usr/lib/node_modules/pm2/bin/pm2'
        ]
      }
      

      I appreciate any help getting this sorted.

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

        @theaddies what happened right before the error?
        did u upgrade node or npm?
        did you have a power failure?

        Sam

        How to add modules

        learning how to use browser developers window for css changes

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

          @sdetweil My girfriends daughter pulls the plug on it. So yea, a power failure.

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

            @theaddies ouch…

            ‘maybe’ this will work, but most of the time I have to replace the sd card

            try

            sudo npm uninstall pm2 -g
            

            I would reboot here

            then use my script to add it back
            see https://github.com/sdetweil/MagicMirror_scripts

            the fixuppm2 command at the bottom of the page

            even if it works, I would plan to get off that sd card asap

            use my backup/restore scripts to backup the MM info
            https://github.com/sdetweil/MagicMirror-backup-restore

            I am testing a new release,
            select the withfiles dropdown before copy/pasting the backup command

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • T Offline
              theaddies
              last edited by

              Does duplicating the card duplicate the flaw or is the copy good? Or is there a way I can make a copy of the important parts of the OS without duplicating the card?

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

                @theaddies copying the card copies the troubles

                only way is to start over.

                use my backup script to save your mm config and modules list for reinstall on restore

                use my install script to I shall mm after a new SD card is made and booted

                then run restore

                it’s the fastest way, least amount of work

                Sam

                How to add modules

                learning how to use browser developers window for css changes

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

                  @sdetweil Thanks for the reply. I started over. I just made a posts where I ran your script and can’t get it to work. I don’t know how I ever got this thing working in the first place. I have 3 of them running and now I can’t anything to go. My other post is awaiting approval.

                  S 3 Replies Last reply Reply Quote 0
                  • S Offline
                    sdetweil @theaddies
                    last edited by

                    @theaddies I don’t see any pending posts

                    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 @theaddies
                      last edited by

                      @theaddies script is copy paste the line from GitHub to terminal window, and hit enter

                      show me the ~/install.log

                      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 @theaddies
                        last edited by

                        @theaddies which script? install or backup?

                        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