How to Install Node.js via NVM on CentOS 7
Node.js is a cross-platform runtime environment, configurable on Linux, OS X, and Microsoft Windows, and built on JavaScript. Applications, both server-side and networking, are also written in JavaScript. Node.js lends itself nicely to quick deploying, real-time web applications, and is generally thought of as extremely scalable due to its event-driven architecture.
The Node Version Manager allows admins to easily manage node.js versions. It’s a bash script that has the capability to manage multiple active versions of node.js, with functionality such as installation, executing commands with specific node.js versions, setting the PATH variable to use a specific node.js versions, etc.
- These instructions are intended specifically for installing Node.js via NVM (Node Version Manager) on a single CentOS 7 node.
- I’ll be working from a Liquid Web Core Managed CentOS 7 server, and I’ll be logged in as root.
- If NVM is not already installed, then visit our tutorial on: How to Install NVM (Node Version Manager) for Node.js on CentOS 7
If NVM is not already installed, then visit our tutorial on: How to Install NVM (Node Version Manager) for Node.js on CentOS 7
Versions that are available for installation:
nvm ls-remote
In addition to the versions listed by the output of that command, it is also possible to install the latest stable or unstable versions, as shown in the next step.
To download, compile, and install the latest version in the v0.11.x release of node.js:
nvm install 0.11
To display currently activated version:
nvm current
Which gives me the output:
v0.11.16 (npm v2.3.0)
In this case I am now running v0.11.16.
To download, compile, and install the latest stable release of node.js, which in this case is v0.12.2:
nvm install stable
To display currently activated version:
nvm current
Now gives me the output:
v0.12.2 (npm v2.7.4)
In this case I am now running v0.12.2.
nvm ls
Gives the following output:
v0.11.16
-> v0.12.2
node -> stable (-> v0.12.2) (default)
stable -> 0.12 (-> v0.12.2) (default)
unstable -> 0.11 (-> v0.11.16) (default)
iojs -> iojs- (-> N/A) (default)
And finally, if you want to modify PATH to use v0.11.16 again, then use the following command:
nvm use 0.11.16
Which returns:
Now using node v0.11.16 (npm v2.3.0)
Related Articles:
- How to Install Adminer MySQL Database Management Tool on AlmaLinux
- How to Edit the PHP Memory for Your WordPress Site via WP Toolkit
- 4 Methods for How to Install Yarn on Windows Server
- How to Install Bpytop Resource Monitoring Tool on AlmaLinux
- How to Fix “This Site Can’t Provide a Secure Connection” Error
- How to Install MongoDB on AlmaLinux
About the Author: J. Mays
As a previous contributor, JMays shares his insight with our Knowledge Base center. In our Knowledge Base, you'll be able to find how-to articles on Ubuntu, CentOS, Fedora and much more!
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.
Latest Articles
How to Install Adminer MySQL Database Management Tool on AlmaLinux
Read ArticleWhat is CGI-Bin and What Does it Do?
Read ArticleTop 10 Password Security Standards
Read ArticleTop 10 Password Security Standards
Read ArticleHow to Use the WP Toolkit to Secure and Update WordPress
Read Article