Switching node versions with Homebrew
Just a quick trick to switch between node versions when you install more than one version through Homebrew (brew install node
).
You check the currently selected version with node --version
.
Working out version from paths in brew list node
or looking for an asterisk next to a version listed in brew info node
can also be used if you’re after a different package.
1) List the versions present on your system:
brew list --versions node
2) Switch to one of the versions, in my case I’m switching to 6.2.2:
brew switch node 6.2.2
That’s it, you can verify the operation was successful with node --version
.