curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Then restart your terminal or run:
source ~/.nvm/nvm.sh
nvm install node
To install a specific version:
nvm install 20.12.2
nvm use node
nvm alias default node
brew update
brew upgrade node
node -v
Note: Homebrew installs Node globally. Managing multiple versions is harder compared to nvm.
If you previously installed Node without nvm and want to clean it up:
sudo rm -rf /usr/local/bin/node
sudo rm -rf /usr/local/lib/node_modules/npm
For development workflows, nvm is highly recommended — it allows you to switch Node versions easily per project and avoid permission issues.
Work with our skilled Node developers to accelerate your project and boost its performance.
Hire Node.js Developers