Best Way To Manage Node.js

It is very common to have multiple versions of Node.js. In this case, we recommend using nvm to manage the Node.js versions.

If you have Node.js installed, try removing it using:

brew uninstall node

Then you can install nvm instead:

brew install nvm

Then you can follow the instructions:

ℹ️

Make sure you restart the terminal or run source ~/.zshrc

Then you can run this command to install Node.js of a specific version:

nvm install 22

If you have multiple versions, you can use this command to switch versions:

nvm use 22