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»Programming»Nodejs»How to Install NVM on Fedora 35/34/33

    How to Install NVM on Fedora 35/34/33

    RahulBy RahulSeptember 8, 20203 Mins ReadUpdated:February 14, 2022

    NVM (Node Version Manager) is a command-line utility for managing multiple active Node.js versions. Sometimes you required to deploy multiple node application with different-2 versions. Nvm will help you here.

    Why NVM ?

    NVM has a number of benefits:

    • It allows installation of multiple node versions on single system and easily switch between them
    • Nvm install all the node version for the current user only. So it will not make any conflict between other system accounts
    • Easier to switch between different downloaded versions of Node.js with ease.

    Installing NVM on Fedora

    A shell script is available for the installation of nvm on Fedora Linux systems. Open a terminal on your system or connect a remote system using SSH. Use the following commands to install curl on your system, then run the nvm installer script.

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

    It creates a .nvm directory under the home directory. Where nvm keeps own binary file and all other required files. Then it sets environment in users .bashrc file. You need to load this environment to set required configuration by running the following command:

    source ~/.bashrc
    

    Installing Node with NVM

    Nvm allows to install multiple node versions on your system for the logged in user. You can find all the available Node version for installation by running command:

    nvm ls-remote 
    

    Above command will show you a list of available node versions. Now you can install any node version by typing:

    nvm install 12.8.3 
    

    Just change 12.8.3 with your required version like 11.15.0, 10.11.0, etc.

    It also provided alias for the latest stable node version, LTS version and other previous LTS version.

    nvm install node        ## install latest stable version 
    nvm install lts/*       ## install latest lts version 
    

    You can also use lts/dubnium, lts/carbon etc.

    Working with NVM

    You can use the following command to list installed versions of node for the current user.

    nvm ls 
    

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

    nvm ls-remote 
    

    You can also select a different version for the current session. The selected version will be the currently active version for the 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 the below command:

    nvm exec 12.18.3 server.js 
    

    Uninstall Specific Node Version with NVM

    You can remove any unused version by running the following command. Just make sure the version you are removing is not currently active version.

    To remove Node.js 9.9.0, type:

    nvm uninstall 9.9.0 
    

    Conclusion

    This tutorial helped you to install nvm and node on Fedora Linux system. You also learned about basics of nvm command line utility.

    node NodeJs npm nvm
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Setup Let’s Encrypt (Certbot) on Ubuntu 20.04
    Next Article What are the Python Random Functions?

    Related Posts

    How To Install Node.js on Ubuntu 22.04

    Updated:May 27, 20223 Mins Read

    How To Install NVM on Ubuntu 22.04

    Updated:April 16, 20223 Mins Read

    How To Install NVM on Windows

    Updated:April 16, 20223 Mins Read

    How To Install Node.Js on Debian 11

    Updated:February 11, 20226 Mins Read

    How To Install NVM on Debian 11

    Updated:August 31, 20213 Mins Read

    How To Use Environment Variables in Node.js

    6 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.