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

[ERROR] _ is not defined

Scheduled Pinned Locked Moved Solved Troubleshooting
36 Posts 3 Posters 2.8k 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.
  • N Offline
    nowayto
    last edited by May 8, 2025, 7:22 PM

    Hi,
    I have an issue, appeared after MMM-SolarPicture installation but I don’t think it’s related to it. Maybe an error on my configuration.

    pm2 logs is this one below

    0|mm | [2025-05-08 21:00:29.772] [ERROR] _ is not defined
    0|mm | [2025-05-08 21:00:29.826] [ERROR] _ is not defined
    0|mm | [2025-05-08 21:01:53.233] [ERROR] _ is not defined
    0|mm | [2025-05-08 21:01:53.327] [ERROR] _ is not defined
    0|mm | [2025-05-08 21:03:16.264] [ERROR] _ is not defined
    0|mm | [2025-05-08 21:03:16.440] [ERROR] _ is not defined
    0|mm | [2025-05-08 21:04:39.584] [ERROR] _ is not defined
    0|mm | [2025-05-08 21:04:39.676] [ERROR] _ is not defined
    0|mm | sh: 1: ./node_modules/.bin/electron: not found
    0|mm | sh: 1: ./node_modules/.bin/electron: not found
    0|mm | sh: 1: sh: 1: ./node_modules/.bin/electron: not found
    0|mm | ./node_modules/.bin/electron: not found
    0|mm | sh: 1: ./node_modules/.bin/electron: not found
    0|mm | sh: 1: ./node_modules/.bin/electron: not found
    0|mm | sh: 1: ./node_modules/.bin/electron: not found

    0|mm | > magicmirror@2.31.0-develop start
    0|mm | > npm run start:x11
    0|mm | > magicmirror@2.31.0-develop start:x11
    0|mm | > DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js
    0|mm | sh: 1: ./node_modules/.bin/electron: not found
    PM2 | App [mm:0] exited with code [0] via signal [SIGINT]
    PM2 | App [mm:0] starting in -fork mode-
    PM2 | App [mm:0] online
    0|mm | > magicmirror@2.31.0-develop start
    0|mm | > npm run start:x11
    0|mm | > magicmirror@2.31.0-develop start:x11
    0|mm | > DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js
    0|mm | sh: 1: ./node_modules/.bin/electron: not found
    PM2 | App [mm:0] exited with code [0] via signal [SIGINT]
    PM2 | App [mm:0] starting in -fork mode-
    PM2 | App [mm:0] online

    npm run config:check gave me that result:

    magicmirror@2.31.0-develop config:check
    node js/check_config.js

    node:internal/modules/cjs/loader:1228
    throw err;
    ^

    Error: Cannot find module ‘eslint’
    Require stack:

    • /home/MYMIRRORNAME/MagicMirror/js/check_config.js
      at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
      at Module._load (node:internal/modules/cjs/loader:1051:27)
      at Module.require (node:internal/modules/cjs/loader:1311:19)
      at require (node:internal/modules/helpers:179:18)
      at Object. (/home/MYMIRRNAME/MagicMirror/js/check_config.js:6:20)
      at Module._compile (node:internal/modules/cjs/loader:1469:14)
      at Module._extensions…js (node:internal/modules/cjs/loader:1548:10)
      at Module.load (node:internal/modules/cjs/loader:1288:32)
      at Module._load (node:internal/modules/cjs/loader:1104:12)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:173:12) {
      code: ‘MODULE_NOT_FOUND’,
      requireStack: [ ‘/home/MYMIRRORNAME/MagicMirror/js/check_config.js’ ]
      }

    Node.js v20.18.1

    thank you for your help

    S 1 Reply Last reply May 8, 2025, 8:03 PM Reply Quote 0
    • N Offline
      nowayto @sdetweil
      last edited by May 11, 2025, 9:45 PM

      @sdetweil
      Sam… I don’t know how to saying it.
      I figure out the issue.

      After your last message I tried what you suggest.
      With the default cfg I had no errors, with mine I had errors.

      So I checked again and again the config…
      and I find an underscore _ right at the start of the config

      npm config:check told me “no syntax errors” and that confusing me.

      When I edit it I use nano editor
      I do “sudo nano config.js” and I press CTRL + _ to jump at the 250 line.
      Might be one of the latest time I opened it and press _ a bit faster than CTRL and I add it for error.

      In addition I notice that when I open config.js with nano editor the green cursor is, clearly, at the start of the first line… EXACTLY on the undescore _ and it hides it.

      I’m really sorry for bothering you with that.
      How can I buy you a coffee ?
      Thanks

      S 1 Reply Last reply May 11, 2025, 10:08 PM Reply Quote 0
      • S Away
        sdetweil @nowayto
        last edited by sdetweil May 8, 2025, 8:08 PM May 8, 2025, 8:03 PM

        @nowayto >Node.js v20.18.1

        2.31.0 requires node 22.14 or above

        how did you get here?

        also you are on 2.31.0-develop

        so you had a temp fix
        and didn’t read the post i put out

        https://forum.magicmirror.builders/topic/19561/version-2.31.0-april-1-2025-upgrade-reminder

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        N 2 Replies Last reply May 9, 2025, 6:00 AM Reply Quote 0
        • N Offline
          nowayto @sdetweil
          last edited by May 9, 2025, 6:00 AM

          @sdetweil I didn’t update MM since I’ve installed it months ago, so I suppose it wasn’t that. Might be it updated automatically?

          I remember you told me to use a “temp fix” to solve a problem.
          Now I’ll follow your guide in the post to update it.
          Thanks

          1 Reply Last reply Reply Quote 0
          • N Offline
            nowayto @sdetweil
            last edited by May 9, 2025, 6:02 AM

            @sdetweil Do you suggest to update manually or auto? Thanks

            S 1 Reply Last reply May 9, 2025, 11:19 AM Reply Quote 0
            • S Away
              sdetweil @nowayto
              last edited by sdetweil May 9, 2025, 11:20 AM May 9, 2025, 11:19 AM

              @nowayto i never suggest update automatically.
              use my script

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              N 1 Reply Last reply May 9, 2025, 9:58 PM Reply Quote 0
              • N Offline
                nowayto @sdetweil
                last edited by May 9, 2025, 9:58 PM

                @sdetweil I’m sorry for the question: that script?

                bash -c “$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/upgrade-script.sh)”

                Thanks

                S 1 Reply Last reply May 9, 2025, 10:03 PM Reply Quote 0
                • S Away
                  sdetweil @nowayto
                  last edited by May 9, 2025, 10:03 PM

                  @nowayto yes, but its two steps

                  one time without any parameters (test mode)
                  and one time with apply

                  all you have to do is click/copy the first time and run it
                  then do the same on the second if the first ends successfully

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  N 1 Reply Last reply May 9, 2025, 10:20 PM Reply Quote 0
                  • N Offline
                    nowayto @sdetweil
                    last edited by May 9, 2025, 10:20 PM

                    @sdetweil MM doesn’t work.

                    I tried a config check but I have this error now.
                    I tried to “npm install eslint -g” but the error persist

                    npm run config:check

                    magicmirror@2.31.0 config:check
                    node js/check_config.js

                    node:internal/modules/cjs/loader:1404
                    throw err;
                    ^

                    Error: Cannot find module ‘eslint’
                    Require stack:

                    • /home/MYMIRR/MagicMirror/js/check_config.js
                      at Module._resolveFilename (node:internal/modules/cjs/loader:1401:15)
                      at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
                      at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
                      at Module._load (node:internal/modules/cjs/loader:1211:37)
                      at TracingChannel.traceSync (node:diagnostics_channel:322:14)
                      at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
                      at Module.require (node:internal/modules/cjs/loader:1487:12)
                      at require (node:internal/modules/helpers:135:16)
                      at Object. (/home/MYMIRR/MagicMirror/js/check_config.js:6:20)
                      at Module._compile (node:internal/modules/cjs/loader:1730:14) {
                      code: ‘MODULE_NOT_FOUND’,
                      requireStack: [ ‘/home/MYMIRR/MagicMirror/js/check_config.js’ ]
                      }

                    Node.js v22.15.0

                    S 1 Reply Last reply May 9, 2025, 10:22 PM Reply Quote 0
                    • S Away
                      sdetweil @nowayto
                      last edited by sdetweil May 9, 2025, 10:28 PM May 9, 2025, 10:22 PM

                      @nowayto show me the ~/MagicMirror/installers/upgrade.log

                      note: I had a typo in log filename

                      and then do

                      cd ~/MagicMirror
                      npm install
                      

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      N 2 Replies Last reply May 10, 2025, 6:41 AM Reply Quote 0
                      • N Offline
                        nowayto @sdetweil
                        last edited by May 10, 2025, 6:41 AM

                        @sdetweil

                        Upgrade started - Sat May 10 00:06:51 CEST 2025
                        system is Linux magicmirror2 6.1.21-v7+ #1642 SMP Mon Apr 3 17:20:52 BST 2023 armv7l GNU/Linux
                        doing test run = true, NO updates will be applied!
                        the os is PRETTY_NAME=“Raspbian GNU/Linux 11 (bullseye)” NAME=“Raspbian GNU/Linux” VERSION_ID=“11” VERSION=“11 (bullseye)” VERSION_CODENAME=bullseye ID=raspbian ID_LIK>
                        architecture from dpkg is armhf
                        ^[[96mCheck current Node installation …^[[0m
                        ^[[0mNode currently installed. Checking version number.
                        ^[[0mMinimum Node version: ^[[1mv22.14.0^[[0m
                        ^[[0mInstalled Node version: ^[[1mv22.15.0^[[0m
                        ^[[92mNo Node.js upgrade necessary.^[[0m
                        ^[[96mCheck current NPM installation …^[[0m
                        ^[[0mNPM currently installed. Checking version number.
                        ^[[0mMinimum npm version: ^[[1mV10.9.2^[[0m
                        ^[[0mInstalled npm version: ^[[1mV11.3.0^[[0m
                        ^[[92mNo npm upgrade necessary.^[[0m

                        saving custom.css
                        remote name = origin
                        upgrading from version 2.31.0 to 2.31.0
                        fetching latest revisions
                        git fetch rc=0
                        current branch = master
                        On branch master
                        Your branch is up to date with ‘origin/master’.

                        Untracked files:
                        (use “git add …” to include in what will be committed)
                        core
                        errorcal.txt
                        errorcal2.txt
                        errorcal3.txt
                        errorcal4.txt
                        errorcal5.txt
                        nohup.out
                        run-start.sh
                        splashscreen/

                        nothing added to commit but untracked files present (use “git add” to track)
                        no files different from github version

                        S 1 Reply Last reply May 10, 2025, 11:54 AM Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 1 / 4
                        1 / 4
                        • First post
                          7/36
                          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