Read the statement by Michael Teeuw here.
fix for black screen in 2.16 and later
-
@sdetweil I did everything as you said, but …
[17.12.2021 04:05.03.723] [ERROR] WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module ‘request’
Require stack:- /home/pi/MagicMirror/modules/MMM-bitcoin/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
-
@arena and , what is the module/library u need to install?
-
@sdetweil fiddled all day today and figured out
it turned out I did not install or update the dependencies inside the modulesorry, thanks
-
@sdetweil Hello everyone, I haven’t been here for a while and my Magic Mirror was switched off…after I switched it on again I made updates to the modules via remote…but I still don’t have any display for some modules like Tankerkönig…when I start the Mirror it always says “Modules cannot be loaded”.
Now, as described by sdetweil, there are commands that you have to execute in the modules in question…but unfortunately I haven’t quite understood how I have to do this in the right order?
It would be really nice if you could explain to me how I have to proceed in order to display the modules again, such as Tankerkönig or mmm-fuel.
Thank you very much in advance for your help.
Greetings
Kussel
i don´t understand that here:
npm install ??? where ??? is the library noted in the message Cannot find module ‘???’ | in the example message above, ??? is request to find this message, look in the output of npm start. or if you use pm2 to launch mm do pm2 logs --lines=50
how do I proceed exactly?
pi@raspberrypi:~/MagicMirror/modules/MMM-Tankerkoenig $ npm init -y Wrote to /home/pi/MagicMirror/modules/MMM-Tankerkoenig/package.json: { "name": "MMM-Tankerkoenig", "version": "1.0.0", "description": "This is a module for the [MagicMirror²](https://github.com/MichMich/MagicMirror/) which displays a fuel prices from [Tankerkoenig](https://www.tankerkoenig.de/).", "main": "MMM-Tankerkoenig.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "git+https://github.com/terenc3/MMM-Tankerkoenig.git" }, "keywords": [], "author": "", "license": "ISC", "bugs": { "url": "https://github.com/terenc3/MMM-Tankerkoenig/issues" }, "homepage": "https://github.com/terenc3/MMM-Tankerkoenig#readme"
-
@kusselin find the messages output by mm
search the messages for one like shown (without the ???)
find the name of the library in quotes (now u have ???)
issue a command using that info
-
@sdetweil thank you…it´s working now.
-
I ran the command as recommended (request was my error as well). I now have this error and MM will not load:
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module ‘logger’
Require stack:- /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 Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
at Function.n._resolveFilename (node:electron/js2c/browser_init:249:1128)
at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29)
at Module._load (node:internal/modules/cjs/loader:785:27)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object. (/home/pi/MagicMirror/js/app.js:13:13)
at Module._compile (node:internal/modules/cjs/loader:1116:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1169:10)
-
@lmac well you ran it in the wrong place… oops
do this
cd ~/MagicMirror rm -rf node_modules rm package-lock.json npm install
then for whatever module was causing problem
cd ~/MagicMirror/modules/modulename
do the same last 3 steps as above
AND THENnpm install request --save
-
Just wanted to say thanks for the fix here.
Did an update and hit exactly this with MMM-GmailFeed and the request module.
Installed it back (with an audit fix afterwards) and now all up and running again :)
-
@darrenhill said in fix for black screen in 2.16 and later:
with an audit fix afterwards
don’t do those… many times leave more trouble than they fix…
we can’t suppress the audit warning message