-
Notifications
You must be signed in to change notification settings - Fork 3
NVM
Solomon Defi edited this page Oct 12, 2021
·
1 revision
-
Install NVM with brew
# Uninstall existing NodeJS, if present brew uninstall --ignore-dependencies node brew uninstall --force node # Install NVM brew upgrade brew install nvm mkdir ~/.nvm
-
Edit environment file
vi ~/.bash_profile --- export NVM_DIR=~/.nvm source $(brew --prefix nvm)/nvm.sh
-
Reload shell environment
source ~/.bash_profile
# Install latest LTS stable
nvm install 14
nvm ls
---
-> v14.17.5
v16.6.2
default -> 14 (-> v14.17.5)
...
Node v14 installs NPM v6. To upgrade to the latest working for the current node version v7:
nvm install-latest-npm
npm -v
---
7.20.6
# See all available versions
nvm ls-remote
# See locally installed versions
nvm ls
# Switch between versions
nvm use 14
nvm use default
...
# Set the default version to LTS
nvm alias default 'lts/*'