How to install NVM on Ubuntu?

Yobi Bina Setiawan
28 Jan 2025 ยท FrontEnd and DevOps

NVM (Node Version Manager) is a command-line tool that allows you to manage multiple versions of Node.js on a single system. Let's Learn

To install NVM (Node Version Manager) on Ubuntu, follow these steps:

  1. Update the package list: Open your terminal and run:

    bash
    sudo apt update
  2. Install prerequisites: You need curl to download the installation script. Install it using:

    bash
    sudo apt install curl
  3. Download and install NVM: Use the following command to download the installation script for NVM:

    bash
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
  4. Activate NVM: The installer will add the necessary lines to your shell profile file (like .bashrc, .bash_profile, or .zshrc). To activate NVM, either restart your terminal or run the following:

    bash
    source ~/.bashrc

    (or replace .bashrc with your specific shell file, e.g., .zshrc for Zsh).

  5. Verify the installation: To check if NVM was installed successfully, run:

    bash
    nvm --version

    You should see the NVM version printed in the terminal.

That's it! You've successfully installed NVM on your Ubuntu system.

Keep Healthy and Happy Coding! ๐Ÿ˜‰