Featured image of post Collection of Common Commands for Node.js NVM: Downloading and Switching Versions

Collection of Common Commands for Node.js NVM: Downloading and Switching Versions

NVM is a Node.js version manager that allows users to run multiple versions of Node.js on the same machine. Here are some...

nvm is a Node.js version manager that allows users to run multiple versions of Node.js on the same machine. Below are some commonly used nvm commands and their usage:

  1. nvm install <version>: Installs the specified version of Node.js. For example, to install Node.js version 14.17.0, run the following command:

    1
    
    nvm install 14.17.0
    
  2. nvm use <version>: Switches to the specified version of Node.js. For instance, to use Node.js version 14.17.0, run:

    1
    
    nvm use 14.17.0
    
  3. nvm ls: Lists all currently installed Node.js versions.

  4. nvm ls-remote: Displays all available Node.js versions.

  5. nvm uninstall <version>: Uninstalls the specified version of Node.js.

  6. nvm alias <name> <version>: Creates an alias for a specified version. For example, to create an alias default for Node.js version 14.17.0, use the command:

    1
    
    nvm alias default 14.17.0
    

    After running this command, the Node.js version with the alias default will be automatically used each time you open a terminal.

  7. nvm current: Shows the version number of the currently active Node.js.

  8. nvm version: Displays the currently installed version of nvm.

These are some of the commonly used nvm commands and their functionalities. You can run nvm --help or check the nvm documentation for more information.

Licensed under CC BY-NC-SA 4.0