Recommended: Use nvm (Node Version Manager)

Step 1: Install nvm

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

Step 2: Install Latest Node.js

nvm install node

To install a specific version:
nvm install 20.12.2

Step 3: Set Default Node Version

nvm use node
nvm alias default node

Alternative: Use Homebrew

Step 1: Upgrade Node via Homebrew

brew update
brew upgrade node

Step 2: Check Node Version

node -v

Note: Homebrew installs Node globally. Managing multiple versions is harder compared to nvm.

Optional: Cleanup Old Global Installations

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

Also Read

Also Read:

Node JS Multer

Tip

For development workflows, nvm is highly recommended — it allows you to switch Node versions easily per project and avoid permission issues.

Need Help With Node Development?

Work with our skilled Node developers to accelerate your project and boost its performance.

Hire Node.js Developers

Support On Demand!

Related Q&A