DEV Community

Pratik Thapa
Pratik Thapa

Posted on

NVM Commands Cheat Sheet

I keep forgetting these commands. So, let's put is all together.

Installing

  • Follow installation steps:

nvm-sh/nvm

List Available Releases


nvm ls-remote
nvm ls-remote | grep -i "latest"
nvm ls-remote | grep i "<node_version>"
Enter fullscreen mode Exit fullscreen mode

Install a Node Version

nvm install <node_version>
Enter fullscreen mode Exit fullscreen mode

List Installed Versions

nvm ls
Enter fullscreen mode Exit fullscreen mode

Aliasing

  • Set a specific version as default
nvm alias default <node_version>
Enter fullscreen mode Exit fullscreen mode
  • Set a user defined alias to a node version
nvm alias <alias_name> <node_version>
Enter fullscreen mode Exit fullscreen mode
  • Remove the alias name
nvm unalias <alias_name> 
Enter fullscreen mode Exit fullscreen mode

Switch to a version (Use)

 # don't have to match exact number. `nvm use 16`
nvm use <node_version>
# or use the latest   
nvm use --lts
Enter fullscreen mode Exit fullscreen mode

Get path to installed node

# /Users/pratikthapa/.nvm/versions/node/v20.10.0/bin/node
nvm which node 
Enter fullscreen mode Exit fullscreen mode

Uninstall a Version of NodeJs

nvm uninstall <node_version> # a specific version
nvm uninstall --lts # Uninstall the latest LTS release
Enter fullscreen mode Exit fullscreen mode

Help

nvm --help # get help documents
Enter fullscreen mode Exit fullscreen mode

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay