Web/Etc

[Node] NVM (Node Version Manager)

llHoYall 2020. 8. 30. 13:31
※ 08.30.2020 - v1.1.7

nvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell.

Installation

On Mac

$ brew install nvm

Next, create a folder for nvm.

$ mkdir ~/.nvm

After installs it, add the below code in your shell profile.

export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm"

On Windows

If you use Chocolatey, you can easily install it.

$ choco install -y nvm

Usage

Show current nvm version

$ nvm version

Show currently activated version

$ nvm current

Show installed node version

$ nvm ls

Show available versions on remote

$ nvm ls-remote

Show available versions

$ nvm ls available

Install latest or LTS node version

$ nvm install latest
$ nvm install --lts

Install node specified version

$ nvm install <version>

Use node specified version

$ nvm use <version>
반응형