Skip to content

Instantly share code, notes, and snippets.

@rekomat
Last active September 29, 2023 16:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rekomat/70902556d5a867707a7a855b666e7c23 to your computer and use it in GitHub Desktop.
Save rekomat/70902556d5a867707a7a855b666e7c23 to your computer and use it in GitHub Desktop.

nvm Cheatsheet

Check if nvm is installed

command -v nvm

Get currently active version

nvm current -- or -- node -v

Un-/Install a specific version

nvm install 16.2.0 nvm uninstall 16.2.0

Switch to a specific version

nvm use 14

Show versions available

locally installed versions: nvm ls available versions: nvm ls-remote

Set default version

nvm alias default 14.17.0 nvm alias default 14

How To Update Node Using a Package Manager

  • First Check the version of installed npm using npm -v and then update it to latest version using npm install npm@latest -g
  • To update Node, you’ll need npm’s handy n module. Run this code to clear npm’s cache, install n, and install the latest stable version of Node sudo npm cache clean -f sudo npm install -g n sudo n stable
  • To install the latest released version, use n latest. Alternatively, you can run n #.#.# to get a specific Node version.

Source: How to Update Node.JS to Latest Version (Linux, Ubuntu, OSX, Windows, Others)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment