Read the statement by Michael Teeuw here.
[ERROR] _ is not defined
- 
 @sdetweil npm install results ~/MagicMirror $ npm install 
 npm error code ENOTEMPTY
 npm error syscall rename
 npm error path /home/MYMIRR/MagicMirror/node_modules/es-abstract
 npm error dest /home/MYMIRR/MagicMirror/node_modules/.es-abstract-fSsKyNTi
 npm error errno -39
 npm error ENOTEMPTY: directory not empty, rename ‘/home/MYMIRR/MagicMirror/node_modules/es-abstract’ -> ‘/home/MYMIRR/MagicMirror/node_modules/.es-abstract-fSsKyNTi’
 npm error A complete log of this run can be found in: /home/MYMIRR/.npm/_logs/2025-05-10T06_40_55_661Z-debug-0.logTried with sudo ~/MagicMirror $ sudo npm install 
 npm error code EBADENGINE
 npm error engine Unsupported engine
 npm error engine Not compatible with your version of node/npm: magicmirror@2.31.0
 npm error notsup Not compatible with your version of node/npm: magicmirror@2.31.0
 npm error notsup Required: {“node”:“>=22.14.0”}
 npm error notsup Actual: {“npm”:“11.2.0”,“node”:“v20.18.1”}
 npm error A complete log of this run can be found in: /root/.npm/_logs/2025-05-10T06_41_52_949Z-debug-0.lognpm seems to see an old version of nodejs but: ~/MagicMirror $ node -v 
 v22.15.0I don’t know what happened. 
 If it can help I had first problem after the MMM-SolarPicture
 but I’ve just installed it and configured it through config.js… nothing more than usual…but the actual behaviour is that pm2 status says it’s running, but on the monitor I see just the raspbian desktop │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ 
 ├────┼───────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
 │ 0 │ mm │ default │ N/A │ fork │ 4311 │ 19s │ 64 │ online │ 0% │ 2.6mb │ ber… │ disabled │
- 
 @nowayto two things doing test run = true, NO updates will be applied! 
 upgrading from version 2.31.0 to 2.31.0doing test run changes nothing, its a safety check and i wont let you upgrade over the same release accidentally so you need to rerun the command and add forceto the end 
- 
 @nowayto NEVER use sudo with any npm command the number in the pm2 status 4311 is the number of restarts youve got a mess now we HAVE to use sudo to undo it cd ~/MagicMirror sudo rm -rf node_modules cd fonts sudo rm -rf node_modules cd ..\vendor sudo rm-rf node_modules cd ..lets see about node which node n q to quit nvmdont do anything else til we figure out the nodejs problem 
- 
 @sdetweil I’m sorry :( I did it what you suggest and config:check gave me a module error again. Different than one before npm run config:check magicmirror@2.31.0 config:check 
 node js/check_config.jsnode:internal/modules/cjs/loader:1404 
 throw err;
 ^Error: Cannot find module ‘ajv’ 
 Require stack:After “require stack” there are other lines, if you need it, tell me. 
 Thanks
- 
 i said stop we need to fix nodejs so npm install will work node -v says something 
 and npm install says node is differenti am trying to figure out where node is installed and by who 
 system, nvm or nyou didn’t give me answers to the commands i provided 
- 
 which node gave me 
 /home/MYMIRR/.nvm/versions/node/v22.15.0/bin/noden gave me 
 node/20.18.1Use up/down arrow keys to select a version, return key to install, d to delete, q to quit nvm gave me Node Version Manager (v0.39.5) Note: refers to any version-like string nvm understands. This includes : - full or partial version numbers, starting with an optional “v” (0.10, v0.1.2 , v1)
- default (built-in) aliases: node, stable, unstable, iojs, system
- custom aliases you define with nvm alias foo
 followed by a lot of options 
- 
 @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 .nvmnow which node 
 should find /usr/local/bin/nodenow we need n to get to node 22.14.0 sudo n 22.14.0now node -v should return 22.14.0 if so, do cd ~/MagicMirror npm installnow MagicMirror should run 
- 
 @sdetweil Thank you a lot Sam. I did everything but 
 I have an [ERROR] _ is not definedmagicmirror@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
- 
 @nowayto so that sounds like the npm install failed again do it again and show the output 
- 
 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-notifierInstalling 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-notifierInstalling 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 
 runnpm fundfor details
