Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Programming»Nodejs»How To Install NVM on Debian 10

    How To Install NVM on Debian 10

    By RahulSeptember 5, 20202 Mins Read

    NVM is a command-line version manager for the Node.js programming language . With the help of nvm utility, you can install multiple node.js versions on a single machine. You can also choose specific Node version for applications. It also provides an option to auto select Node version using .nvmrc configuration file.

    Advertisement

    This tutorial will help you to install nvm on Debian 10 Linux system. It will also help you to install different Node version and other useful examples.

    Prerequisites

    • A running Debian 10 Linux system with shell access.
    • Login with a user account to which you need to install Node.js.

    Installing NVM on Debian

    You can use a shell script to install NVM on Debian 10 Buster Linux system. Firstly, Open a terminal on your machine. For the remote machines connect via the SSH. Make sure your system have curl command line installed, then execute the nvm installer script on terminal.

    sudo apt install curl 
    curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash 
    

    Above script makes all the required environment settings to login script of current logged in user. To apply the settings logout and login again to account or just execute below command to do the same.

    source ~/.profile   
    

    Installing Node using NVM

    You can install multiple Node.js versions using nvm. And use required version for your application from installed Node.js.

    Install the latest version of Node.js. Here node is the alias for the latest version.

    nvm install node 
    

    To install a specific version of node:

    nvm install 12.18.3  
    

    You can choose any other version to install using above command. The very first version installed becomes the default. New shells will start with the default version of node (e.g., nvm alias default).

    Working with NVM

    You can use the following command to list installed version’s of Node for the current user.

    nvm ls 
    

    With this command you can find available Node.js version for the installation.

    nvm ls-remote 
    

    You can also select a different version for the current session. This will be current active version for current shell only.

    nvm use 12.18.3 
    

    To find the default Node version set for the current user, type:

    nvm run default --version 
    

    You can run a Node script with the desired version of node.js using belwo command:

    nvm exec 12.18.3 server.js 
    

    Conclusion

    This tutorial helped you to install nvm on Debian 10 Buster Linux system. You also get some useful information about uses of NVM.

    Debian 10 node node.js nvm
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Create a Basic CRUD API in NodeJS, ExpressJS and MySQL

    How to Install NVM on CentOS Stream 9 & RHEL 9

    How to Install Node.js on CentOS Stream 9 & RHEL 9

    View 2 Comments

    2 Comments

    1. Jeez on September 24, 2021 1:18 am

      Seriously? Run an unknown shell script from an unknown source and execute it?

      Reply
      • Damien on November 29, 2021 12:33 am

        Exactly. That’s where I switched off too.

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • A Comprehensive Look at the Simple Mail Transfer Protocol (SMTP)
    • Understanding Basic Git Workflow: Add, Commit, Push
    • The Difference Between Git Reset –soft, –mixed, and –hard
    • Understanding the Staging Area in Git’s Workflow
    • Python Function with Parameters, Return and Data Types
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.