Read the statement by Michael Teeuw here.
Any module other than default breaks my mirror
-
When I install a module I get an issue with the mirror not working and get errors like below - I don’t understand it sufficiently well enough to understand how to resolve the problem: any help greatly appreciated thanks
raspberry@raspberry:~ $ npm run config:check
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/raspberry/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open ‘/home/raspberry/package.json’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoentnpm ERR! A complete log of this run can be found in:
npm ERR! /home/raspberry/.npm/_logs/2023-08-27T20_27_49_271Z-debug.log
raspberry@raspberry:~ $ ^C -
@Rhosybol have to be IN the MagicMirror folder for those commands
cd ~/MagicMirror npm run config:check
-
@sdetweil Hi, thanks so much for your lightning wuick reply - that resolved my issue on my virtual machine but I think masked another issue on my Pi 3B - as before I installed MMM-SORT and checked the config file - all good however when I run npm start dev now I get the following - I should say I’ve tried rebuilding my pi several times over the last few days to try and get to the bottom of it and it is only when I add a module that the mirror stops working (despite run config:check not coming back with any errors)… I have built several in the past and never had this issue adding modules before - I have no idea what’s happening…
raspberry@raspberrypi:~/MagicMirror $ npm start dev
magicmirror@2.24.0 start
DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js dev[28.08.2023 07:50.46.062] [LOG] Starting MagicMirror: v2.24.0
[28.08.2023 07:50.46.075] [LOG] Loading config …
[28.08.2023 07:50.46.081] [DEBUG] config template file not exists, no envsubst
[28.08.2023 07:50.46.091] [LOG] Loading module helpers …
[28.08.2023 07:50.46.094] [LOG] No helper found for module: alert.
[28.08.2023 07:50.46.115] [ERROR] (node:1863) UnhandledPromiseRejectionWarning: Error: Cannot find module ‘request’
Require stack:- /home/raspberry/MagicMirror/modules/MMM-SORT/node_helper.js
- /home/raspberry/MagicMirror/js/app.js
- /home/raspberry/MagicMirror/js/electron.js
- /home/raspberry/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js
- at Module._resolveFilename (node:internal/modules/cjs/loader:1082:15)
at n._resolveFilename (node:electron/js2c/browser_init:2:117469)
at Module._resolveFilename (/home/raspberry/MagicMirror/node_modules/module-alias/index.js:49:29)
at Module._load (node:internal/modules/cjs/loader:927:27)
at f._load (node:electron/js2c/asar_bundle:2:13330)
at Module.require (node:internal/modules/cjs/loader:1148:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object. (/home/raspberry/MagicMirror/modules/MMM-SORT/node_helper.js:8:17)
at Module._compile (node:internal/modules/cjs/loader:1269:14)
at Module._extensions…js (node:internal/modules/cjs/loader:1324:10)
at Module.load (node:internal/modules/cjs/loader:1124:32)
at Module._load (node:internal/modules/cjs/loader:965:12)
at f._load (node:electron/js2c/asar_bundle:2:13330)
at Module.require (node:internal/modules/cjs/loader:1148:19)
at require (node:internal/modules/cjs/helpers:110:18)
at loadModule (/home/raspberry/MagicMirror/js/app.js:180:19)
(Useelectron --trace-warnings ...
to show where the warning was created)
[28.08.2023 07:50.46.116] [ERROR] (node:1863) 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)
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
-
@sdetweil I was reading some other issues similar to mine and I ran npm install request in the MMM-SORT module and after 20 minutes it had finished - I rebooted and everything came up working as I needed it to be - thanks for your help - very much appreciated!