Skip to content

How To Update Node.js

oznu edited this page May 5, 2021 · 13 revisions

Homebridge requires Node.js installed on your system to run. From time to time you will need to update the Node.js runtime to enable support for new features.

Homebridge (and verified plugins) support all current Active and Maintenance LTS releases of Node.js. At the time of writing, this means we will support:

  • Node.js 10.x until April 2021
  • Node.js 12.x until April 2022
  • Node.js 14.x until April 2023
  • Node.js 16.x from October 2021 until April 2024

Homebridge does not support odd-numbered releases of Node.js, such as 11.x, 13.x or 15.x.

Should I Update Node.js?

Updating Node.js is not a risk-free exercise, so it is recommended users only do so when required.

  • If you are running Node.js v10.x now is a good time to update.
  • If you are running Node.js v12.x there is no urgent need to update, as we will still be supporting this version until April 2022, however you can still do so if you like.

How To Update Node.js

If you have followed one of the Homebridge Install Guides, you can refer back to the guide for your platform to see how to update Node.js.

macOS and Linux

For Linux and macOS users, we have created a tool to help you update Node.js in a safe way using hb-service (even if you aren't using hb-service to manage the process):

sudo hb-service update-node

This tool will only update Node.js if it can safely do so. If you've installed Node.js in a non-standard way, it will not change your system.

You can roll back to a previous version by appending the version number to the command:

sudo hb-service update-node 12.19.0

Windows 10

Windows 10 users can view update instructions here.

Docker

Users running in Docker should update Node.js by pulling down the latest version of the Homebridge Docker Image.

While not recommended, if you are using the "Ubuntu" or "Debian" variant of the image, you can also update inside the container using hb-service update-node and then restarting manually. Users running the "Alpine Linux" variant cannot use hb-service update-node.

What To Avoid

It is important to update Node.js using the same method you originally used to install it, or using hb-service update-node.

  • Do not update Node.js using instructions you found on some random site on the internet.
  • Avoid nvm or n - these are great tools for developers, but require additional configuration when running Homebridge as a service user.

Failing to adhere to these guidelines will likely result in you having multiple copies of Node.js installed which will cause many strange problems (if you have done this, see how to fix it on Linux and macOS).

Clone this wiki locally