Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»General Articles»How To Install NVM on Debian 9

    How To Install NVM on Debian 9

    RahulBy RahulNovember 7, 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.

    You can also create an .nvmrc configuration file to auto select Node version.

    This tutorial help you to install NVM on your system and managing multiple Node.js version.

    Prerequisites

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

    Installing NVM on Debian

    Use a shell script to install and configure NVM on your Debian system. Download the shell script from Github and execute on your system.

    Also, you can download and run this script in single command. Open a terminal and execute below commands.

    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 explained how to install nvm on Debian 9 Linux system.

    node node.js nvm
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Git on Ubuntu 20.04
    Next Article How to Install .NET Core on Debian 10

    Related Posts

    What is CPU? – Definition, Types and Parts

    3 Mins Read

    How to Install Ionic Framework on Ubuntu 22.04

    3 Mins Read

    What is the /etc/hosts file in Linux

    Updated:June 27, 20222 Mins Read

    Creating DMARC Record for Your Domain

    Updated:June 29, 20223 Mins Read

    What is Computer Hardware?

    4 Mins Read

    What is Information Technology (IT)?

    Updated:June 29, 20223 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • What is CPU? – Definition, Types and Parts
    • What is the /etc/aliases file
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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