Homebridge-hue: Recommendation: best way to update nodeJS?

Created on 13 Sep 2018  路  3Comments  路  Source: ebaauw/homebridge-hue

@ebaauw what process/steps would you recommend to upgrade nodeJS and packages that were compiled on previous versions? homebridge-hue updates its node version more frequently than others, but I鈥檓 afraid to update node a lot of times. Don鈥檛 get me wrong, I love that you鈥檙e always keeping it updated, I just want to streamline my own process so that I don鈥檛 end up out of date.

question

All 3 comments

In my experience, homebridge (and other packages using C modules) break only when the major version of NodeJS changes (e.g. 8.x.x -> 10.x.x). In that case, best uninstall and re-install the package to force re-compilation of the C modules:

sudo npm -g un homebridge
sudo npm -g i homebridge --unsafe-perm

I stay on the latest long-term support (LTS) version of NodeJS, so this would be needed only once a year or so.

Erik,

I'm going to have to update Node in order to use your homebridge-hue plugin. Do you have a process / trick for doing the uninstall / reinstall of Homebridge with the latest node, while still keeping all the Homebridge config intact? That is I know how to just restore the config file, but is there anyway to do all this and still keep the config in the Home app intact? As though the Home app doesn't know any uninstall actually happened? Will just restoring the .homebridge folder back to it current state be adequate? And also NOT opening the Home app until Homebridge is reinstalled?

Thanks

Homebridge installs to /usr/lib/node_modules or somewhere similar; your configuration is in ~/.homebridge. Re-installing homebridge doesn鈥檛 touch your configuration. The Home app will just show accessories as not responding when homebridge isn鈥檛 running. The only thing to avoid is running homebridge without all plugins, or when plugins won鈥檛 expose all accessories. HomeKit will remove the missing accessories and when they鈥檙e present again after restarting homebridge, HomeKit will see them as new accessories, losing any room, group, and scene assignments and any automations.

See above how to uninstall and re-install homebridge after updating node to a different major version.

Was this page helpful?
0 / 5 - 0 ratings