Installing Nodejs and configuring the environment under the Linux system (Centos)

Source: Internet
Author: User

Summarize the installation Nodejs under CentOS and configure the environment to record the method of successful installation. The recommended installation method is to use the compiled binaries installed, not recommended to use the form of source code installation, one is the source of trouble, the second is the need to download and compile their own waste time.

1. Installing Nodejs

Visit Nodejs's official website of Downdolad, url: https://nodejs.org/en/download/, you can see the latest Nodejs downloads, including different versions, as shown below.

Back to the Linux virtual machine, in console input

wget https://

According to the downloaded file you can see that it is compressed in. XZ mode, so you cannot download directly using the Linux command tar.

Xz-d NODE-V8.9.0-LINUX-X64.TAR.XZ

TAR-XVF Node-v8.9.0-linux-x64.tar

MV Node-v8.9.0-linux-x64 node-v8.9.0

To verify that node can be used, we can enter the CD Node-v8.9.0/bin, enter the./node-v to view the node version and successfully install the node version.

2. Configure Nodejs

To be able to use node globally, you need to add a connection to the console and enter the following command to implement it.

Ln-s/root/node-v8.9.0/bin/node/usr/local/bin/node  -s/root/node-v8.9.0/bin/npm/usr/local/bin/npm

Prior to installing CentOS is the 5.8 version of XZ that is not installed GLIBC version is also low and does not support the latest Nodejs version.

Installing Nodejs and configuring the environment under the Linux system (Centos)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.