Read the statement by Michael Teeuw here.
Module MMM-OpenWeatherMapForecast is not running
-
@sdetweil Thank you for your response.
When I change the line 63 I got the following error when I start my MMM
[2024-09-07 09:56:11.233] [ERROR] (node:3736) UnhandledPromiseRejectionWarning: /home/pi/MagicMirror/modules/MMM-OpenWeatherMapForecast/node_helper.js:3 Node Helper for MMM-OpenWeatherMapForecast. ^^^^^^ SyntaxError: Unexpected identifier 'Helper' at internalCompileFunction (node:internal/vm:73:18) at wrapSafe (node:internal/modules/cjs/loader:1160:20) at Module._compile (node:internal/modules/cjs/loader:1212:27) at Module._extensions..js (node:internal/modules/cjs/loader:1311:10) at Module.load (node:internal/modules/cjs/loader:1098:32) at Module._load (node:internal/modules/cjs/loader:945:12) at c._load (node:electron/js2c/node_init:2:13672) at Module.require (node:internal/modules/cjs/loader:1122:19) at require (node:internal/modules/helpers:130:18) at loadModule (/home/pi/MagicMirror/js/app.js:187:19) at loadModules (/home/pi/MagicMirror/js/app.js:217:10) at async App.start (/home/pi/MagicMirror/js/app.js:272:3) (Use `electron --trace-warnings ...` to show where the warning was created) [2024-09-07 09:56:11.240] [ERROR] (node:3736) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
I checked the line a few times to make sure I hadn’t mistyped it.
-
@Klinge looks like you must have have changed something else
in the module folder do
git diff
to see the changes
-
@Klinge Just tested the module and it is working fine for me. The module requires a language in the config but it is not in the sample. So you may want to check that. As for the error you are getting, Have you changed anything in line one of the node_helper? The comment section.
-
@sdetweil Ok, I did “git diff” and got the following result
pi@raspberrypi:~/MagicMirror/modules/MMM-OpenWeatherMapForecast $ git diff diff --git a/node_helper.js b/node_helper.js index 74c92ae..620e2b5 100644 --- a/node_helper.js +++ b/node_helper.js @@ -1,4 +1,4 @@ **-/*********************************** +//********************************* Node Helper for MMM-OpenWeatherMapForecast. @@ -60,7 +60,7 @@ module.exports = NodeHelper.create({ self.sendSocketNotification("OPENWEATHER_ONE_CALL_FORECAST_DATA", resp); } else { - console.log("[MMM-OpenWeatherMapForecast] " + moment().format("D-MMM-YY HH:mm") + " ** ERROR ** " + error); + console.log("[MMM-OpenWeatherMapForecast] " + moment().format("D-MMM-YY HH:mm") + " ** ERROR ** " + response.statusCode); } }); diff --git a/package-lock.json b/package-lock.json index e597610..5fdbf9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,51 +1,72 @@ { "name": "mmm-openweathermapforecast", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "debug": { + "packages": { + "": { + "name": "mmm-openweathermapforecast", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "moment": "^2.28.0", + "needle": "^2.5.2" + } + }, + "node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "requires": { + "dependencies": { "ms": "^2.1.1" } }, - "iconv-lite": { + "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { + "dependencies": { "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" } }, - "moment": { + "node_modules/moment": { "version": "2.29.1", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", - "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==", + "engines": { + "node": "*" + } }, - "ms": { + "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, - "needle": { + "node_modules/needle": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/needle/-/needle-2.5.2.tgz", "integrity": "sha512-LbRIwS9BfkPvNwNHlsA41Q29kL2L/6VaOJ0qisM5lLWsTV3nP15abO5ITL6L81zqFhzjRKDAYjpcBcwM0AVvLQ==", - "requires": { + "dependencies": { "debug": "^3.2.6", "iconv-lite": "^0.4.4", "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" } }, - "safer-buffer": { + "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "sax": { + "node_modules/sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
Because the colours of the result could be important, I have also included a screenshot as an attachment.
-
@mumblebaj Thank you for your advice. I configured the following line in my config
language: "de",
and I changed the node.helper as @sdetweil had advised
-
@Klinge yes, line 1 you accidentally added an extra / to the beginning
this makes it a single line comment and the next line becomes active
in a diff, red is old, green is new
-
@sdetweil Now I corrected the first line and then I tried to update the module again.
What should I say. Now the MMM is running.
But now I have on my second mirror another problem. I will open a new post for it.
Thank you all for your help :-)
-