Setting an old/LTS version of Node as default with Homebrew

So you need an old (or LTS) version of Node as default?

→ Putting this here for the next time I need it…

At the time of writing (April 2022) the latest version of Node is 18.x

Consequently I hit an error like

node >=14.19.0 <17.0.0 required, but you have 18.0.0

Why? RedwoodJS needs an LTS version of Node.

To make that happen…

  1. Make sure we have the required version. For me that’s Node 16.
brew install node@16
  1. Remove the symlink to the default/latest and relink to the specific one we just installed
brew unlink node
brew link --overwrite node@16

  1. Check we have the right version
➜  node --version
v16.15.0

Happy days 🙂