07-21-2023, 12:23 PM
Using brew and nvm on Mac OSX:
If you're not using nvm, first uninstall nodejs. Then install Homebrew if not already installed. Then install nvm and node:
<!-- language: lang-bsh -->
brew install nvm
nvm ls-remote # find the version you want
nvm install v7.10.0
nvm alias default v7.10.0 # set default node version on a shell
You can now easily switch node versions when needed.
Bonus: If you see a "tar: invalid option" error when using nvm, `brew install gnu-tar` and follow the instructions brew gives you to set your PATH.
If you're not using nvm, first uninstall nodejs. Then install Homebrew if not already installed. Then install nvm and node:
<!-- language: lang-bsh -->
brew install nvm
nvm ls-remote # find the version you want
nvm install v7.10.0
nvm alias default v7.10.0 # set default node version on a shell
You can now easily switch node versions when needed.
Bonus: If you see a "tar: invalid option" error when using nvm, `brew install gnu-tar` and follow the instructions brew gives you to set your PATH.