Mystery Data
  • Home
  • Tutorials
    • WordPress
    • Linux
    • Centos
    • MySQL/MariaDB
  • Control Panel
    • CWP
    • Vesta CP
  • Contact Me
  • Privacy Policy

Mystery Data

  • Home
  • Tutorials
    • WordPress
    • Linux
    • Centos
    • MySQL/MariaDB
  • Control Panel
    • CWP
    • Vesta CP
  • Contact Me
  • Privacy Policy
CentosControl PanelCWPLinuxUbuntuVesta CP

How Install Nodejs via NVM – Node Version Manager and Useful Commands

by Sandy May 13, 2018
written by Sandy May 13, 2018

In this tutorial we’ll install NVM – Node Version Manager, NVM provides an option for easy installation of Node.js also you can also install specific version of  Node.js and multiple Node.js versions on the same system using nvm and use required version for application. NVM will solve the issue with the different versions are required for your application.

This tutorial will work on many OS and at the time I tested with Ubuntu and CentOS including control panels centos webpanel – CWP, vestacp, cpanel, webmin, diretadmin etc.

Lets get Started :

Step 1 :

For Ubuntu install cURL first :

apt-get install curl -y

Install NVM from Git :

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

You can close the ssh session and start it again or Reload system environment via this command :

Centos :

source ~/.bashrc

Ubuntu :

source ~/.profile

Lists Of NVM commands :

To list all nodejs version

nvm ls-remote

To install multiple nodejs or single version :

nvm install v10.1.0

along with version 8 and 9 :

nvm install v8.11.1
nvm install v9.11.1

Stetting up Node.js Default Version :

nvm list

the output will be like this :

[root@mysterydata ~]# nvm list
        v8.11.1
        v9.11.1
->      v10.1.0
         system
default -> v10.1.0
node -> stable (-> v10.1.0) (default)
stable -> 10.1 (-> v10.1.0) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> v8.11.1)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.14.2 (-> N/A)
lts/carbon -> v8.11.1

here “-> v10.1.0” is the default version, “-> ” is the default indicator

To change the Default nodejs version to version 8 run this command :

nvm use v8.11.1

then again run

nvm list

output :

[root@mysterydata ~]# nvm list
->      v8.11.1
        v9.11.1
        v10.1.0
         system
default -> v10.1.0
node -> stable (-> v10.1.0) (default)
stable -> 10.1 (-> v10.1.0) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> v8.11.1)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.14.2 (-> N/A)
lts/carbon -> v8.11.1

you can also verify via this command :

node --version

To remove specific node version which is already installed run this command :

nvm list

Then run to remove the version :

nvm remove v9.11.1

If this post helps you in any way please consider a donation

md-donate
0 comment
1
FacebookTwitterGoogle +Pinterest
previous post
How to Install Nodejs and NPM on Centos CWP and VestaCP
next post
How to Upgrade MySQL and Install MariaDB 10.2 on Ubuntu 18.04 LTS and 16.04 LTS

You may also like

How to Upgrade PHP 5.6 to PHP 7.3...

December 29, 2018

How to Install/build PHP 7.3 manually on CWP...

December 29, 2018

Update/Upgrade to MariaDB 10.3 on VestaCP/CWP/CentOS 7

September 8, 2018

Upgrade/Update to Latest Version of TeamSpeak 3 in...

September 1, 2018

Increase Import/Upload limit for phpMyAdmin and File Manager...

August 27, 2018

How to Enable HTTP/2 for Apache in CWP...

August 17, 2018

How to Configure/Install Let’s Encrypt SSL on VestaCP...

August 12, 2018

How to Install CyberPanel – OpenLiteSpeed Control Panel...

July 24, 2018

How to Install Memcached and Redis PHP Extensions...

July 23, 2018

How to Enable open_basedir with suPHP globally and...

July 21, 2018

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

md-donate

Recent Posts

  • How to Upgrade PHP 5.6 to PHP 7.3 on CentOS VestaCP
  • How to Install/build PHP 7.3 manually on CWP – Centos Web Panel
  • Update/Upgrade to MariaDB 10.3 on VestaCP/CWP/CentOS 7
  • Upgrade/Update to Latest Version of TeamSpeak 3 in CWP
  • Increase Import/Upload limit for phpMyAdmin and File Manager in CWP
  • How to Enable HTTP/2 for Apache in CWP with mod_http2 module
  • How to Configure/Install Let’s Encrypt SSL on VestaCP Mail Server and Vesta Admin – CentOS and Ubuntu
  • How to Install CyberPanel – OpenLiteSpeed Control Panel on Centos 7
  • How to Install Memcached and Redis PHP Extensions with Php Selector 5.6/7.0/7.1/7.2 CWP- Centos WebPanel
  • How to Enable open_basedir with suPHP globally and for Per User Basis on CWP – Centos WebPanel
Footer Logo

Copyright - Mystery Data