HommiePeter / homebridge-toon-platform

Homebridge Platform to disclose Toon Thermostat and its connected devices (Smoke Detectors, Wallplugs, Huelights) to homekit
GNU General Public License v3.0
5 stars 4 forks source link

Error when starting plugin #2

Closed MrSnoebel closed 2 years ago

MrSnoebel commented 3 years ago

(node:17425) UnhandledPromiseRejectionWarning: Error: Cannot find module 'node-fetch' Require stack:

Fresh install of the plugin, I am migrating form the old 'jochem725' to this new version. Homebridge is 1.3.4, running in a docker enviroment. Node.js version v14.17.1 Npm version v6.14.13

Config: { "platform": "Toon-Platform", "apiToken": "<>", "switch_smoke": true, "switch_hue": false, "switch_wallplug": true, "agreementIndex": "0", "name": "Toon" }

jednl commented 2 years ago

I've got the same issue, also in a docker enviroment.

Any suggestions?

Jacques

unequalsine commented 2 years ago

Same issue.

lensen commented 2 years ago

npm install node-fetch@2.6.6 resolved it for me.

jednl commented 2 years ago

Thanks! That worked.

gielk commented 2 years ago

I have installed this, but this is not resolving the problem for me.

I'm still getting the next error.

[29/12/2021, 18:32:03] Error: Cannot find module 'node-fetch' Require stack:

jednl commented 2 years ago

Do you use a docker enviromemt? I installed it with the terminal in homebridge-ui.

gielk commented 2 years ago

Do you use a docker enviromemt? I installed it with the terminal in homebridge-ui.

I don’t use a docket environment. I also installed it using homebridge-ui.

jednl commented 2 years ago

Then we have to wait for an answer from @HommiePeter.

gielk commented 2 years ago

sudo npm install -g node-fetch@2.6.6

fixed the problem for me.

HommiePeter commented 2 years ago

Guy's I released a new version (release 0.9.6) today, which will install the node-fetch as a dependency during installation of the new version of the plugin so that the workaround of doing a sudo npm install -g node-fetch@2.6.6 in the package folder (/usr/lib/node_modules/homebridge-toon-platform) is no longer needed.