Skip to content

Instantly share code, notes, and snippets.

@jonjack
Created February 18, 2025 10:32
Show Gist options
  • Save jonjack/3c6de485a537392922f97644612240ba to your computer and use it in GitHub Desktop.
Save jonjack/3c6de485a537392922f97644612240ba to your computer and use it in GitHub Desktop.
macOS Install NVM & Node

macOS Install NVM & Node

This guide assumes a clean install. If you have Node already uninstalled then remove it first.

Install NVM

You can install NVM with brew but it isn't fully supported so go with the official instructions for piece of mind.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# or
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

Either open a new shell or refresh your environment.

bash: source ~/.bashrc
zsh: source ~/.zshrc
ksh: . ~/.profile

Check the install.

command -v nvm
nvm

nvm -v
0.40.1

Install Node

List available versions.

nvm ls-remote    
                                                                                                                 ✔ 
  v0.1.14
  v0.1.15
  v0.1.16
  v0.1.17
  .......

Install.

# latest
nvm install node

# specific version(s)
nvm install 14.7.0 
nvm install 16.3.0, 12.22.1  # multiple versions

Example.

nvm install 22.10.0                                                                                                           127 ✘ 
Downloading and installing node v22.10.0...
Downloading https://nodejs.org/dist/v22.10.0/node-v22.10.0-darwin-arm64.tar.xz...
########################################################################################################################################## 100.0%
Computing checksum with shasum -a 256
Checksums matched!
Now using node v22.10.0 (npm v10.9.0)
Creating default alias: default -> 22.10.0 (-> v22.10.0)

The first version installed becomes the default.

To set an alias:

nvm alias my_alias v14.4.0

NPM is installed as part of Node.

npm -v                                                                                                                     ✔  6s  
10.9.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment