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.

    [ERROR] _ is not defined

    Scheduled Pinned Locked Moved Solved Troubleshooting
    36 Posts 3 Posters 6.0k 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.
    • S Offline
      sdetweil @nowayto
      last edited by sdetweil

      @nowayto ok nvm and n do the same function but differently

      i use n in my scripts because it runs everywhere

      so lets turn off nvm

      nvm deactivate
      nvm unload
      cd ~
      rm -rf  .nvm
      

      now which node
      should find /usr/local/bin/node

      now we need n to get to node 22.14.0

      sudo n 22.14.0
      

      now node -v

      should return 22.14.0

      if so, do

      cd  ~/MagicMirror 
      npm install
      

      now MagicMirror should run

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

        @sdetweil Thank you a lot Sam.

        I did everything but
        I have an [ERROR] _ is not defined

        magicmirror@2.31.0 start:x11
        DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js

        [2025-05-11 15:39:26.429] [LOG] Starting MagicMirror: v2.31.0
        [2025-05-11 15:39:26.527] [LOG] Loading config …
        [2025-05-11 15:39:26.537] [LOG] config template file not exists, no envsubst
        [2025-05-11 15:39:28.154] [INFO] Checking config file /home/MYMIRR/MagicM irror/config/config.js …
        [2025-05-11 15:39:28.478] [INFO] Your configuration file doesn’t contain syntax errors :)
        [2025-05-11 15:39:28.482] [INFO] Checking modules structure configuration …
        [2025-05-11 15:39:28.793] [ERROR] _ is not defined

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

          @nowayto so that sounds like the npm install failed again

          do it again and show the output

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

            @sdetweil

            installer didn’t failed, but this is the result now

            npm install

            magicmirror@2.31.0 postinstall
            npm run install-vendor && npm run install-fonts && echo "MagicMirror² installation finished successfully!
            "

            magicmirror@2.31.0 install-vendor
            echo "Installing vendor files …
            " && cd vendor && npm install --loglevel=error --no-audit --no-fund --no-update-notifier

            Installing vendor files …

            up to date in 7s

            magicmirror@2.31.0 install-fonts
            echo "Installing fonts …
            " && cd fonts && npm install --loglevel=error --no-audit --no-fund --no-update-notifier

            Installing fonts …

            up to date in 3s
            MagicMirror² installation finished successfully!

            magicmirror@2.31.0 prepare
            [ -f node_modules/.bin/husky ] && husky || echo no husky installed.

            up to date in 45s

            285 packages are looking for funding
            run npm fund for details

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

              @nowayto weird, and npm start fails again _ not defined?

              i installed solarpicture without problems

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

                @sdetweil
                I’m sure.I don’t think SolarPicture could be the problem.

                Yes, the error keep showing

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

                  @nowayto wild, lets do this… intall MM again, but save the current…

                  #backup MM config and modules list
                  bash -c  "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror-backup-restore/main/mm_backup.sh)"
                  #rename the MagicMirror folder out of the way
                  cd ~
                  mv MagicMirror MagicMirror.save
                  #and install MM again
                  bash -c  "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/raspberry.sh)"
                  #restore the  MM config and modules
                  bash -c  "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror-backup-restore/main/mm_restore.sh)" 
                  

                  then

                  cd ~/MagicMirror
                  npm start 
                  

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

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

                    @sdetweil
                    Before writing here I made backups, locally and on github, like you taught me in the past :)

                    Now I’ll try

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

                      @sdetweil

                      That’s incredible… I did it, everything goes good… no issues but when I start it

                      npm start

                      magicmirror@2.31.0 start
                      npm run start:x11

                      magicmirror@2.31.0 start:x11
                      DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js

                      [2025-05-11 22:44:21.593] [LOG] Starting MagicMirror: v2.31.0
                      [2025-05-11 22:44:21.682] [LOG] Loading config …
                      [2025-05-11 22:44:21.687] [LOG] config template file not exists, no envsubst
                      [2025-05-11 22:44:23.250] [INFO] Checking config file /home/MYMIRR/MagicMirror/config/config.js …
                      [2025-05-11 22:44:23.532] [INFO] Your configuration file doesn’t contain syntax errors :)
                      [2025-05-11 22:44:23.535] [INFO] Checking modules structure configuration …
                      [2025-05-11 22:44:23.824] [ERROR] _ is not defined

                      Again this _ is not defined

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

                        @nowayto wow!!! NOW i am really confused.

                        have you rebooted?

                        if you try the sample config.js

                        cd ~/MagicMirror/config
                        mv config.js config.js.save
                        cp config.js.sample config.js
                        

                        and then
                        npm start

                        does it run or fail

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        N 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 3 / 4
                        • 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