ebaauw / homebridge-ws

Homebridege plugin for virtual weather station
Apache License 2.0
106 stars 4 forks source link

update 2.2.5 breaks homebridge #9

Closed cbrandlehner closed 5 years ago

cbrandlehner commented 5 years ago

I installed the last update using homebridge-config-ui and the server did not restart. I found in the documentation that a dependency was removed from this project and has to be installed manually. I did install homebridge-lib but for unknown reason homebridge-ws still can not start.

Why was a dependency moved out of package.json in a minor release? I vote against asking users to install a dependency manually. Especially for those users using dockerized environments with a UI this is not working.

cbrandlehner commented 5 years ago

It looks like homebridge did try load homebridge-ws BEFORE loading homebridge-lib, does that make sense?

[6/10/2019, 3:27:06 PM] Loaded plugin: homebridge-config-ui-x

[6/10/2019, 3:27:06 PM] Registering platform 'homebridge-config-ui-x.config'

[6/10/2019, 3:27:06 PM] ---

[6/10/2019, 3:27:06 PM] Loaded plugin: homebridge-daikin-local

[6/10/2019, 3:27:06 PM] Registering accessory 'homebridge-daikin-local.Daikin-Local'

[6/10/2019, 3:27:06 PM] ---

[6/10/2019, 3:27:06 PM] Loaded plugin: homebridge-luxtronik2

[6/10/2019, 3:27:06 PM] Registering accessory 'homebridge-luxtronik2.temperature'

[6/10/2019, 3:27:06 PM] ---

[6/10/2019, 3:27:06 PM] Loaded plugin: homebridge-mqtt-blinds

[6/10/2019, 3:27:06 PM] Registering accessory 'homebridge-mqtt-blinds.BlindsMQTT'

[6/10/2019, 3:27:06 PM] ---

[6/10/2019, 3:27:08 PM] Loaded plugin: homebridge-mqttthing

[6/10/2019, 3:27:08 PM] Registering accessory 'homebridge-mqttthing.mqttthing'

[6/10/2019, 3:27:08 PM] ---

[6/10/2019, 3:27:09 PM] Loaded plugin: homebridge-onkyo

[6/10/2019, 3:27:09 PM] Registering accessory 'homebridge-onkyo.Onkyo'

[6/10/2019, 3:27:09 PM] ---

[6/10/2019, 3:27:09 PM] Loaded plugin: homebridge-sss-platform

[6/10/2019, 3:27:09 PM] Registering platform 'homebridge-sss-platform.sss-platform'

[6/10/2019, 3:27:09 PM] ---

[6/10/2019, 3:27:10 PM] Loaded plugin: homebridge-synology

[6/10/2019, 3:27:10 PM] Registering accessory 'homebridge-synology.Synology'

[6/10/2019, 3:27:10 PM] ---

[6/10/2019, 3:27:11 PM] Loaded plugin: homebridge-tesla

[6/10/2019, 3:27:11 PM] Registering accessory 'homebridge-tesla.Tesla'

[6/10/2019, 3:27:11 PM] ---

[6/10/2019, 3:27:11 PM] Loaded plugin: homebridge-webos-tv

[6/10/2019, 3:27:11 PM] Registering accessory 'homebridge-webos-tv.webostv'

[6/10/2019, 3:27:11 PM] ---

[6/10/2019, 3:27:11 PM] ====================

[6/10/2019, 3:27:11 PM] ERROR LOADING PLUGIN homebridge-ws:

[6/10/2019, 3:27:11 PM] Error: Cannot find module 'homebridge-lib'

at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)

at Function.Module._load (internal/modules/cjs/loader.js:562:25)

at Module.require (internal/modules/cjs/loader.js:690:17)

at require (internal/modules/cjs/helpers.js:25:18)

at Object.<anonymous> (/homebridge/node_modules/homebridge-ws/lib/WsPlatform.js:8:23)

at Module._compile (internal/modules/cjs/loader.js:776:30)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)

at Module.load (internal/modules/cjs/loader.js:653:32)

at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

at Function.Module._load (internal/modules/cjs/loader.js:585:3)

[6/10/2019, 3:27:11 PM] ====================

[6/10/2019, 3:27:11 PM] Loaded plugin: homebridge-lib

[6/10/2019, 3:27:11 PM] Registering platform 'homebridge-lib.Lib'

[6/10/2019, 3:27:11 PM] ---

[6/10/2019, 3:27:11 PM] Loading 3 platforms...

[6/10/2019, 3:27:11 PM] [Config] Initializing config platform...

[6/10/2019, 3:27:11 PM] [Config] Spawning homebridge-config-ui-x with PID 377

[6/10/2019, 3:27:11 PM] Error: The requested platform 'WS' was not registered by any plugin.

at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:134:13)

at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:327:45)

at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:90:36)

at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10)

at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)

at Module._compile (internal/modules/cjs/loader.js:776:30)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)

at Module.load (internal/modules/cjs/loader.js:653:32)

at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

at Function.Module._load (internal/modules/cjs/loader.js:585:3)

[6/10/2019, 3:27:11 PM] Got SIGTERM, shutting down Homebridge...

ebaauw commented 5 years ago

Looks like homebridge-lib has been installed to a different directory than the other plugins? homebridge-ws cannot to find it, but homebridge can (do you start it with -P?). The order of plugins loading shouldn’t matter, typically, homebridge loads them alphabetically.

cbrandlehner commented 5 years ago

both plugins are in "node_modules". I do not start homebridge using -P.

cbrandlehner commented 5 years ago

Update (please ignore previous post): Actually, homebridge-lib was installed using "sudo npm -g i homebridge-lib". However, the docker image I use, together with homebridge-config-ui does not install accessories using "-g". So indeed, homebridge-lib and homebridge-ws were not in the same node_modules directory.

I purged the global homebridge-lib and re-installed it using homebridge-config-ui.

Although my personal problem is solved by this, I still do not like the idea of having a user crash his homebridge configuration by not reading the documentation in advance carefully.