Install NVM and then install the version of node you need
brew install nvm
mkdir ~/.nvm
Add the following to the end of your .zshrc file, or load the nvm plugin if you’re using oh-my-zsh.
[ -s "/usr/local/opt/nvm/nvm.sh" ] && \. "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
Open a new Terminal
nvm install --lts
node --version
v20.10.0