-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Cannot find module 'request' #2
Comments
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. (/home/magicmirror/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) [13.04.2022 21:53.58.168] [ERROR] Whoops! There was an uncaught exception... [13.04.2022 21:53.58.169] [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. (/home/magicmirror/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/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', undefined ] } [13.04.2022 21:53.58.170] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? [13.04.2022 21:53.58.170] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues |
I (really my friend @viljamip) got this module working with this tip! Here is how:
Save the file.
It seems that request is deprecated. Here is more info about that #request/request#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 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 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
]
The text was updated successfully, but these errors were encountered: