Error: Cannot find module 'request'
Closed this issue · 5 comments
This is what I get when trying to launch MagicMirror after installing your module:
[13.12.2021 04:38.38.095] [ERROR] Error: Cannot find module 'request'
Require stack:
- /home/pi/MagicMirror/modules/MMM-3Day-Forecast/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
- at Module._resolveFilename (internal/modules/cjs/loader.js:887:15)
at Function.n._resolveFilename (electron/js2c/browser_init.js:257:1128)
at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29)
at Module._load (internal/modules/cjs/loader.js:732:27)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Module.require (internal/modules/cjs/loader.js:959:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object. (/home/pi/MagicMirror/modules/MMM-3Day-Forecast/node_helper.js:9:15)
at Module._compile (internal/modules/cjs/loader.js:1078:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/pi/MagicMirror/modules/MMM-3Day-Forecast/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
]
}
[13.12.2021 04:38.38.097] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
[13.12.2021 04:38.38.098] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
[13.12.2021 04:38.38.318] [LOG] Launching application.
^C/home/pi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGINT
Hi, did you do an npm install
in the module directory? If you did were there any errors during that? If there were it may be worth following up on those.
np, if you get the change could you run the npm install
and look for any error output? It would be useful to know if there is a problem that needs addressing.
That's what npm i
returns
up to date in 0.581s
found 0 vulnerabilities
because there are no dependencies in package.json
. But your module needs request which seems to be is not part of MM anymore (since version 2.16).
So we need to install request with npm i request
manually. Pull request: #28
@migasQ Thanks for your help with this, it's much appreciated.