Read the statement by Michael Teeuw here.
MagicMirror cannot start (UnhandledPromiseRejectionWarning)
-
Hi,
my MagicMirror cannot start. If I enter in the MagicMirror folder DISPLAY=:0 npm start, the start process stop with the following error message
pi@raspberrypi:~/MagicMirror $ DISPLAY=:0 npm start > magicmirror@2.26.0 start > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js [02.01.2024 13:42.14.476] [LOG] Starting MagicMirror: v2.26.0 [02.01.2024 13:42.14.486] [LOG] Loading config ... [02.01.2024 13:42.14.494] [DEBUG] config template file not exists, no envsubst [02.01.2024 13:42.14.505] [LOG] Loading module helpers ... [02.01.2024 13:42.14.507] [LOG] No helper found for module: alert. [02.01.2024 13:42.14.572] [ERROR] (node:1277) UnhandledPromiseRejectionWarning: Error: Cannot find module 'command-exists' Require stack: - /home/pi/MagicMirror/modules/default/updatenotification/update_helper.js - /home/pi/MagicMirror/modules/default/updatenotification/node_helper.js - /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 node:internal/modules/cjs/loader:1084:15 at Function.<anonymous> (node:electron/js2c/browser_init:2:117419) at Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29) at node:internal/modules/cjs/loader:929:27 at Function._load (node:electron/js2c/asar_bundle:2:13327) at Module.require (node:internal/modules/cjs/loader:1150:19) at require (node:internal/modules/cjs/helpers:110:18) at Object.<anonymous> (/home/pi/MagicMirror/modules/default/updatenotification/update_helper.js:3:23) at Module._compile (node:internal/modules/cjs/loader:1271:14) at Object..js (node:internal/modules/cjs/loader:1326:10) at Module.load (node:internal/modules/cjs/loader:1126:32) at node:internal/modules/cjs/loader:967:12 at Function._load (node:electron/js2c/asar_bundle:2:13327) at Module.require (node:internal/modules/cjs/loader:1150:19) at require (node:internal/modules/cjs/helpers:110:18) at Object.<anonymous> (/home/pi/MagicMirror/modules/default/updatenotification/node_helper.js:4:22) (Use `electron --trace-warnings ...` to show where the warning was created) [02.01.2024 13:42.14.573] [ERROR] (node:1277) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) [1277:0102/134215.069790:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.portal.Settings.Read: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.portal.Desktop was not provided by any .service files ^C/home/pi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGINT
At the beginning from the start process, the Log write that the config.js file doesn´t exists. But that is not correct. The config file exists in the /config folder.
It would be really nice, if you someone can help me.
Thank you in advance.
Best regards
Klinge -
@Klinge please do
cd ~/MagicMirror npm install
-
@sdetweil Hi Sam, now it works. Thank you for your advice :-)
-
@Klinge thanks… did you do the two part command originally
git pull && npm run install-mm
trying to see if the expression failed
-
Encountering the same problem, however npm install throws an error message:
npm ERR! code EBADENGINE npm ERR! engine Unsupported engine npm ERR! engine Not compatible with your version of node/npm: magicmirror@2.26.0 npm ERR! notsup Not compatible with your version of node/npm: magicmirror@2.26.0 npm ERR! notsup Required: {"node":">=18"} npm ERR! notsup Actual: {"npm":"8.19.4","node":"v16.20.2"}
The “normal” update of my raspi via sudo apt- update & upgrade did not bring any changes, I had to update the node version manually:
Update node version
Please do not forget to log-off / log-on after nvm installationThis helped now the npm install did run through and my magic mirror start again.
Hope this is helpful for others who are encountering the same problem…
-
@Steff use my install/upgrade scripts. they do all this work