Last active
April 22, 2021 20:48
-
-
Save tillig/fea277ef21bf0929d9c64af63f0c50ff to your computer and use it in GitHub Desktop.
Switch versions of Node.js using Homebrew
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From | |
# https://medium.com/@katopz/how-to-install-specific-nodejs-version-c6e1cec8aa11 | |
# See node versions | |
brew search node | |
# Remove the existing symlinks | |
brew unlink node | |
# Install node at specific version | |
brew install node@12 | |
# Link the new node install | |
brew link node@12 --force --overwrite | |
# To revert to node you need to | |
# - unlink the specific install | |
brew unlink node@12 | |
# - force reinstall node because `brew link node` does not | |
# re-link npm, apparently intentionally(?). | |
# https://github.com/Homebrew/homebrew-core/issues/34475 | |
brew reinstall node |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've started using the
n
version manager which works in all shells, unlikenvm
.Note the arrow keys in
n
don't work in PowerShell but you can usej
andk
to navigate instead, and that works fine.