How To Install Multiple Instance of Node using NVM on Centos 7
To Install Multiple Instance of Node using NVM on Centos 7
NVM stands for Node version manager & as you might have guessed with name, its used to control Nodejs versions installed on our system. It is a command line utility, which allows us to use & switch between multiple versions of Nodejs. In this tutorial, you' ll be briefed about the method install multiple instances of Node using NVM on CentOS 7 is covered here.
Installation
Download and install NVM using the following command
[root@linuxhelp11 ~]# curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/ins tall.sh | bash
% Total % Received % Xferd Average Speed Time
Time Time Current
Dload Upload Total Spent Left
Speed
100 12540 100 12540 0 0 49274 0 --:--:-- --:--:--
--:--:-- 49370
=> Downloading nvm as script to ' /root/.nvm'
=> Appending nvm source string to /root/.bashrc
=> Appending bash_completion source string to /root/.bashrc
=> Close and reopen your terminal to start using nvm or run
the following to use it now:
export NVM_DIR=" $HOME/.nvm"
[ -s " $NVM_DIR/nvm.sh" ] & & . " $NVM_DIR/nvm.sh" #
This loads nvm
[ -s " $NVM_DIR/bash_completion" ] & & .
" $NVM_DIR/bash_completion" # This loads nvm
bash_completion
Now, execute the following command for making the NVM work properly
[root@linuxhelp11 ~]# source ~/.bashrc
In order to check NVM version use the following command
[root@linuxhelp11 ~]# nvm --version
0.33.8
In order to Check Node versions available run the following command
[root@linuxhelp11 ~]# nvm ls-remote
v0.1.14
v0.1.15
v0.1.16
v0.1.17
v0.1.18
v0.1.19
v0.1.20
v0.1.21
v0.1.22
v0.1.23
v0.1.24
.
.
.
v9.10.0
v9.10.1
v9.11.0
v9.11.1
Now, to install node version 6.14.1 use the following command
[root@linuxhelp11 ~]# nvm install v6.14.1
Downloading and installing node v6.14.1...
Downloading https://nodejs.org/dist/v6.14.1/node-v6.14.1-
linux-x64.tar.xz...
##############################################
########################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v6.14.1 (npm v3.10.10)
Creating default alias: default -> v6.14.1
To check installed versions of the node use the following command
[root@linuxhelp11 ~]# nvm list
-> v6.14.1
default -> v6.14.1
node -> stable (-> v6.14.1) (default)
stable -> 6.14 (-> v6.14.1) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.14.1
lts/carbon -> v8.11.1 (-> N/A)
Now, to install node version 8.11.1 use the following command
[root@linuxhelp11 ~]# nvm install v8.11.1
Downloading and installing node v8.11.1...
Downloading https://nodejs.org/dist/v8.11.1/node-v8.11.1-
linux-x64.tar.xz...
##############################################
########################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v8.11.1 (npm v5.6.0)
Check installed versions of the node using the following command
[root@linuxhelp11 ~]# nvm list
v6.14.1
-> v8.11.1
default -> v6.14.1
node -> stable (-> v8.11.1) (default)
stable -> 8.11 (-> v8.11.1) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> v8.11.1)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.14.1
lts/carbon -> v8.11.1
Now, To use node version 6.14.1 give the following command
[root@linuxhelp11 ~]# nvm use v6.14.1
Now using node v6.14.1 (npm v3.10.10)
To check node and npm version give the following command
[root@linuxhelp11 ~]# node -v v6.14.1 [root@linuxhelp11 ~]# npm -v 3.10.10
To use node version 8.11.1 give the following command
[root@linuxhelp11 ~]# nvm use v8.11.1
Now using node v8.11.1 (npm v5.6.0)
To check node and npm version give the following command
[root@linuxhelp11 ~]# node -v v8.11.1 [root@linuxhelp11 ~]# npm -v 5.6.0
You can verify it from the below screen.
With this, the method to Install Multiple Instance of Node using NVM on Centos 7 comes to an end.
Comments ( 0 )
No comments available