The following will probably also work on a Mac.
Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
(check for the latest version of nvm here: https://github.com/nvm-sh/nvm)
Then reload the shell configuration
source ~/.bashrc
Check that nvm is installed
nvm -v
Install Node
Use nvm to install the version of node needed. For example:
nvm install --lts
Check that node is installed
node -v
Done!