Closed pixel-lake closed 2 years ago
Thanks :)
I have this running on my mirror, but it's years since I've done a fresh install. Probably the request npm module was available through MagicMirror base dependencies but might have been removed from them since.
Looks like there's no package.json for modules. There's a chance that this could be fixed by adding "request" to https://github.com/MichMich/MagicMirror/blob/master/package.json dependencies. But there's probably a reason why it was removed so a more proper fix would be migrating away from it on my module as well.
Not promising anything, but I might take a look at this at some point :)
Hi,
I have same issue as pixel-lake. Here is my errorcode:
[13.04.2022` 21:53.58.164] [ERROR] WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module 'request' Require stack: - /home/magicmirror/MagicMirror/modules/mm-hsl-timetable/node_helper.js - /home/magicmirror/MagicMirror/js/app.js - /home/magicmirror/MagicMirror/js/electron.js - /home/magicmirror/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js - [13.04.2022 21:53.58.167] [ERROR] App threw an error during load [13.04.2022 21:53.58.167] [ERROR] Error: Cannot find module 'request' Require stack: - /home/magicmirror/MagicMirror/modules/mm-hsl-timetable/node_helper.js - /home/magicmirror/MagicMirror/js/app.js - /home/magicmirror/MagicMirror/js/electron.js - /home/magicmirror/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:1105) at Function.Module._resolveFilename (/home/magicmirror/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:102:18) at Object.
Thanks :)
I have this running on my mirror, but it's years since I've done a fresh install. Probably the request npm module was available through MagicMirror base dependencies but might have been removed from them since.
Looks like there's no package.json for modules. There's a chance that this could be fixed by adding "request" to https://github.com/MichMich/MagicMirror/blob/master/package.json dependencies. But there's probably a reason why it was removed so a more proper fix would be migrating away from it on my module as well.
Not promising anything, but I might take a look at this at some point :)
I (really my friend @viljamip) got this module working with this tip! Here is how:
Stop magicmirror if running.
Edit package.json file with your preferred editor. You can find it in the root of magicmirror. Find "dependencies" and add request like this:
"dependencies": {
"colors": "^1.4.0", "console-stamp": "^3.0.4", "digest-fetch": "^1.2.1", "eslint": "^8.12.0", "express": "^4.17.3", "express-ipfilter": "^1.2.0", "feedme": "^2.0.2", "helmet": "^5.0.2", "iconv-lite": "^0.6.3", "luxon": "^1.21.3", "module-alias": "^2.2.2", "moment": "^2.29.2", "node-fetch": "^2.6.7", "node-ical": "^0.15.1", "socket.io": "^4.4.1", "request": "^2.88.2" <-----------------------------
Save the file.
Install request.
npm install request
Start magicmirror and it should work now.
It seems that request is deprecated. Here is more info about that #https://github.com/request/request/issues/3142
It also seems that magicmirror uses now Node-fetch instead.
Thank you @ZakarFin for this module!
Updated the code to use node-fetch instead. Let me know if you have further issues with this.
Thank you, the updated version works as intended !
Hey! First off, amazing that you have developed this module. Unfortunately I could not get it running, bellow is the error I am getting
Did anybody experience a similar issue? I followed your steps by git cloning the module and added the module object to config file. When I comment out the module object, magic mirror works again.
* ERROR MESSAGE BELOW*** [06.04.2022 19:09.18.238] [ERROR] App threw an error during load [06.04.2022 19:09.18.240] [ERROR] Error: Cannot find module 'request' Require stack:
at Module._resolveFilename (node:internal/modules/cjs/loader:940:15) at Function.n._resolveFilename (node:electron/js2c/browser_init:249:1105) 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:102:18) at Object. (/home/pi/MagicMirror/modules/mm-hsl-timetable/node_helper.js:2:17)
at Module._compile (node:internal/modules/cjs/loader:1116:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)
[06.04.2022 19:09.18.242] [ERROR] Whoops! There was an uncaught exception...
[06.04.2022 19:09.18.246] [ERROR] Error: Cannot find module 'request'
Require stack:
at Module._resolveFilename (node:internal/modules/cjs/loader:940:15) at Function.n._resolveFilename (node:electron/js2c/browser_init:249:1105) 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:102:18) at Object. (/home/pi/MagicMirror/modules/mm-hsl-timetable/node_helper.js:2:17)
at Module._compile (node:internal/modules/cjs/loader:1116:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/pi/MagicMirror/modules/mm-hsl-timetable/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',
undefined
]