Read the statement by Michael Teeuw here.
module not found error loading module in MagicMirror
-
@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 installthen for whatever module was causing problem
cd ~/MagicMirror/modules/modulenamedo 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 -
@sdetweil OK, thanks for the pointer.
Always kinda worried when that style of message pops up, for security and suchlike.
I see from the update that my node is very much out of date, so now just backing things up before setting the update script onto it to try and bring that up too.
-
@darrenhill upgrade is for MM, not node, (altho it might do it, works sometimes, need to move to n) âŚ
easiest is using the node version of nvm, called n
do
sudo npm i n -g PATH="$PATH" n 16then node 16 will be installedâŚ
note that you will have to do another npm install in the mm (and maybe module folders)
this the upgrade would do (with force instead of apply)n also allows you to SWITCH versions, or use a particular version for ONE appâŚ
see n --help -
@sdetweil - I did it via your update script, and it has updated Node from v10.x to v16.x (or at least that is what appears to have happened from what I could read).
Itâs quite an old install that just sits on my desk and largely gets left to its own devices. It is in a PiTop Ceed rather than a true mirror, and basically the only thing it runs is MM (itâs actually a dual-boot via PINN also with RetroPie, but the Raspi OS partition is essentially only MM). So no need to keep things focussed to one app or anything like that - no issue of cross-contamination.
All is working fine after the update though, so no problems.
-
@darrenhill cool. thx for the feedback
-
@sdetweil
Ran your update script today and now got black screen. Should I still check each module for json files and npm install or will the script have done that already?
How to I go about trying to troubleshoot this ? Any help is much appreciated! -
@np27np27 want to see installers/upgrade.log
same process as listed in post 1
ârequestâ is NOT the only library missing
the messages tell you what needs to be added
-
@sdetweil
hi, im getting this error in the pm2 log:/home/pi/.pm2/logs/mm-error.log last 100 lines: 0|mm | the module (for instance, using `npm rebuild` or `npm install`). 0|mm | at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1800) 0|mm | at Object.Module._extensions..node (node:internal/modules/cjs/loader:1199:18) 0|mm | at Object.func [as .node] (node:electron/js2c/asar_bundle:5:1800) 0|mm | at Module.load (node:internal/modules/cjs/loader:988:32) 0|mm | at Module._load (node:internal/modules/cjs/loader:829:12) 0|mm | at Function.c._load (node:electron/js2c/asar_bundle:5:13331) 0|mm | at Module.require (node:internal/modules/cjs/loader:1012:19) 0|mm | at require (node:internal/modules/cjs/helpers:94:18) 0|mm | at bindings (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/bindings/bindings.js:112:48) 0|mm | at /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/epoll.js:7:31 { 0|mm | code: 'ERR_DLOPEN_FAILED' 0|mm | } 0|mm | [30.01.2022 19:11.04.155] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? 0|mm | [30.01.2022 19:11.04.156] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues 0|mm | Gdk-Message: 19:12:35.663: electron: Fatal IO error 11 (Resource temporarily unavailable) on X server :0. 0|mm | 0|mm | [30.01.2022 19:13.00.598] [ERROR] WARNING! Could not load config file. Starting with default configuration. Error found: Error: The module '/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/build/Release/epoll.node' 0|mm | was compiled against a different Node.js version using 0|mm | NODE_MODULE_VERSION 93. This version of Node.js requires 0|mm | NODE_MODULE_VERSION 99. Please try re-compiling or re-installing 0|mm | the module (for instance, using `npm rebuild` or `npm install`). 0|mm | [30.01.2022 19:13.00.615] [ERROR] App threw an error during load 0|mm | [30.01.2022 19:13.00.618] [ERROR] Error: The module '/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/build/Release/epoll.node' 0|mm | was compiled against a different Node.js version using 0|mm | NODE_MODULE_VERSION 93. This version of Node.js requires 0|mm | NODE_MODULE_VERSION 99. Please try re-compiling or re-installing 0|mm | the module (for instance, using `npm rebuild` or `npm install`). 0|mm | at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1800) 0|mm | at Object.Module._extensions..node (node:internal/modules/cjs/loader:1199:18) 0|mm | at Object.func [as .node] (node:electron/js2c/asar_bundle:5:1800) 0|mm | at Module.load (node:internal/modules/cjs/loader:988:32) 0|mm | at Module._load (node:internal/modules/cjs/loader:829:12) 0|mm | at Function.c._load (node:electron/js2c/asar_bundle:5:13331) 0|mm | at Module.require (node:internal/modules/cjs/loader:1012:19) 0|mm | at require (node:internal/modules/cjs/helpers:94:18) 0|mm | at bindings (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/bindings/bindings.js:112:48) 0|mm | at /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/epoll.js:7:31 0|mm | [30.01.2022 19:13.00.622] [ERROR] Whoops! There was an uncaught exception... 0|mm | [30.01.2022 19:13.00.632] [ERROR] Error: The module '/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/build/Release/epoll.node' 0|mm | was compiled against a different Node.js version using 0|mm | NODE_MODULE_VERSION 93. This version of Node.js requires 0|mm | NODE_MODULE_VERSION 99. Please try re-compiling or re-installing 0|mm | the module (for instance, using `npm rebuild` or `npm install`). 0|mm | at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1800) 0|mm | at Object.Module._extensions..node (node:internal/modules/cjs/loader:1199:18) 0|mm | at Object.func [as .node] (node:electron/js2c/asar_bundle:5:1800) 0|mm | at Module.load (node:internal/modules/cjs/loader:988:32) 0|mm | at Module._load (node:internal/modules/cjs/loader:829:12) 0|mm | at Function.c._load (node:electron/js2c/asar_bundle:5:13331) 0|mm | at Module.require (node:internal/modules/cjs/loader:1012:19) 0|mm | at require (node:internal/modules/cjs/helpers:94:18) 0|mm | at bindings (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/bindings/bindings.js:112:48) 0|mm | at /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/epoll.js:7:31 { 0|mm | code: 'ERR_DLOPEN_FAILED' 0|mm | } 0|mm | [30.01.2022 19:13.00.634] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? 0|mm | [30.01.2022 19:13.00.635] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues 0|mm | /home/pi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGINT 0|mm | [31.01.2022 10:27.29.417] [ERROR] WARNING! Could not load config file. Starting with default configuration. Error found: Error: The module '/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/build/Release/epoll.node' 0|mm | was compiled against a different Node.js version using 0|mm | NODE_MODULE_VERSION 93. This version of Node.js requires 0|mm | NODE_MODULE_VERSION 99. Please try re-compiling or re-installing 0|mm | the module (for instance, using `npm rebuild` or `npm install`). 0|mm | [31.01.2022 10:27.29.428] [ERROR] App threw an error during load 0|mm | [31.01.2022 10:27.29.431] [ERROR] Error: The module '/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/build/Release/epoll.node' 0|mm | was compiled against a different Node.js version using 0|mm | NODE_MODULE_VERSION 93. This version of Node.js requires 0|mm | NODE_MODULE_VERSION 99. Please try re-compiling or re-installing 0|mm | the module (for instance, using `npm rebuild` or `npm install`). 0|mm | at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1800) 0|mm | at Object.Module._extensions..node (node:internal/modules/cjs/loader:1199:18) 0|mm | at Object.func [as .node] (node:electron/js2c/asar_bundle:5:1800) 0|mm | at Module.load (node:internal/modules/cjs/loader:988:32) 0|mm | at Module._load (node:internal/modules/cjs/loader:829:12) 0|mm | at Function.c._load (node:electron/js2c/asar_bundle:5:13331) 0|mm | at Module.require (node:internal/modules/cjs/loader:1012:19) 0|mm | at require (node:internal/modules/cjs/helpers:94:18) 0|mm | at bindings (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/bindings/bindings.js:112:48) 0|mm | at /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/epoll.js:7:31 0|mm | [31.01.2022 10:27.29.433] [ERROR] Whoops! There was an uncaught exception... 0|mm | [31.01.2022 10:27.29.439] [ERROR] Error: The module '/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/build/Release/epoll.node' 0|mm | was compiled against a different Node.js version using 0|mm | NODE_MODULE_VERSION 93. This version of Node.js requires 0|mm | NODE_MODULE_VERSION 99. Please try re-compiling or re-installing 0|mm | the module (for instance, using `npm rebuild` or `npm install`). 0|mm | at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1800) 0|mm | at Object.Module._extensions..node (node:internal/modules/cjs/loader:1199:18) 0|mm | at Object.func [as .node] (node:electron/js2c/asar_bundle:5:1800) 0|mm | at Module.load (node:internal/modules/cjs/loader:988:32) 0|mm | at Module._load (node:internal/modules/cjs/loader:829:12) 0|mm | at Function.c._load (node:electron/js2c/asar_bundle:5:13331) 0|mm | at Module.require (node:internal/modules/cjs/loader:1012:19) 0|mm | at require (node:internal/modules/cjs/helpers:94:18) 0|mm | at bindings (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/bindings/bindings.js:112:48) 0|mm | at /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/epoll.js:7:31 { 0|mm | code: 'ERR_DLOPEN_FAILED' 0|mm | } 0|mm | [31.01.2022 10:27.29.440] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? 0|mm | [31.01.2022 10:27.29.441] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues -
Looks like the issue is the PIR sensor module. I believe there is a new PIR module?
-
-
@sdetweil
Thanks, installed the newer PIR module from @bugsounet and all seems to work fine now. Thanks for the help đđž -
S sdetweil referenced this topic on
-
S swvalenti referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
M mumblebaj referenced this topic on
-
K karsten13 referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
M mumblebaj referenced this topic on
-
S sdetweil referenced this topic on
-
M mumblebaj referenced this topic on
-
M mumblebaj referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
@sdetweil Thank you for your instruction.
One question, my modules are in the directory:
home/pi/MagicMirror/modules/default.
You donât mention the default subdirectory.
I presume that my path is okay, because all the modules are located in this subdirectory. Is that okay?
Thank you. -
@lodevries you should never put your extra modules in the default folder, that is reserved for modules MM ships as part of the package
see the âHow to add modulesâ link in my signature below
-
@lodevries you can move the out pretty easily
cd modules/default
mv whatever-name âŚ
then the config.js shoudl change from
âmoduleâ: âdefault/whatever_nameâ
to
âmoduleâ:âwhatever-nameâ -
@sdetweil Thank you.
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
O oggo referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
J JerryP referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
L Lazershrimp referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
K karsten13 referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
K karsten13 referenced this topic on
-
B blackbull referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
S sdetweil referenced this topic on
-
Thank you so much @sdetweil. I tried to update a module, ran out of memory (8GB SD card install), had to upgrade then got the dreaded black screen. Your first post in this thread solved it.
Iâve written a couple of modules, mainly by using other peopleâs code as a base and then changing the functionality, only because my coding is basic.
So⌠one module uses request in the node helper. Youâve already helped someone install it, so thanks for that. The code is
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
var result = JSON.parse(body)
// console.log(response.statusCode + result); // uncomment to see in terminal
self.sendSocketNotification(âTIDAL_RESULTâ, result)
What should I be using instead of ârequestâ?Another module I use is calendarweek. Again its broken through the deprecated function âvalid urlâ and ârruleâ
createFetcher: function(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth) {
var self = this;
if (!validUrl.isUri(url)) {
self.sendSocketNotification(âINCORRECT_URLâ, {url: url});
return;
}
and
if (typeof event.rrule !== âundefinedâ && event.rrule !== null && !isFacebookBirthday) {
var rule = event.rrule;
var addedEvents = 0;// can cause problems with e.g. birthdays before 1900 if(rule.options && rule.origOptions && rule.origOptions.dtstart && rule.origOptions.dtstart.getFullYear() < 1900 || rule.options && rule.options.dtstart && rule.options.dtstart.getFullYear() < 1900){ rule.origOptions.dtstart.setYear(1900); rule.options.dtstart.setYear(1900); } // For recurring events, get the set of start dates that fall within the range // of dates we"re looking for.</code>Is there an elegant solution other than pulling the deprecated libraries?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đ
Register Login