[LIN] Install nvm
nvm is a terminal command that allows you to install and change between different versions of Node.js. Usually, your system can have only one version of Node.js installed at one time. With nvm, you can switch to a newer version, try some new features, and then back to an older version for your more serious projects.
- Run these commands one by one in your terminal:
$ mkdir ~/.nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
- Use your editor to open your terminal settings file (
.zshrc
or.bash_profile
):
$ code ~/$([ -n "$ZSH_VERSION" ] && echo ".zshrc" || echo ".bash_profile")
- In your editor, copy/paste these lines and save:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
- Close and reopen all your terminal windows.