How to install and configure the Node. js environment in CentOS6

Source: Internet
Author: User
Node. javascript, a widely used Javascript runtime environment written in C ++. Currently, many applications are used in WEB applications, and the execution efficiency is very high, although the old left does not work in the development of programs, but sometimes when playing VPS, you will still encounter the use of Node. the JS environment is basic. For example, the establishment of the HEXO loose blog program over the past few days is useful to the node. JS environment configuration. This does not exactly record the configuration based on the CentOS6 system.

 

Because the Node. Js source version we usually use in the default CentOS system is relatively low, and sometimes the compatibility is not very good, so we are installing and configuring Node. in the js environment, you can manually install the latest official version.

 

1. Install the dependency package

 

The code is as follows: Copy code

Yum install gcc-c ++ openssl-devel

 

Generally, the gcc compiler has been installed in CentOS6 to execute the C ++ environment dependency package, but we should install it again to ensure that there is no problem.

 

 

After that, enter gcc-v to check whether the version number is displayed. If yes, it indicates no problem.

 

 

2. Check and verify the Python version

 

The Node. js environment requires Python2.6 or above, and we need to check. If not, install and upgrade the latest Python version.

 

The code is as follows: Copy code

Python -- version

 

Run the command and check the version. I have Python 2.6.6, so there is no problem. You do not need to upgrade it.

 

Third, install the latest version of Node. js.

 

The code is as follows: Copy code

Cd/usr/local/src
Wget http://nodejs.org/dist/node-latest.tar.gz
Tar-zxvf node-latest.tar.gz

 

Download and decompress the Nodejs installation package of the latest official version, and check the current version of the folder to go to the current folder for compilation.

 

 

We can see that the latest version is the node-v0.12.7, and then we enter the current version for compilation.

 

The code is as follows: Copy code

Cd node-v0.12.7
./Configure
Make & make install

 

Let the system execute the installation and compilation process. We can wait, rest, rest, and have a cup of tea.

 

4. Check the Node. js installation

 

 

After the execution is complete, enter node-v to check whether the version is available.

 

To sum up, through the above steps, we can deploy the Node. js framework in our Linux CentOS system environment, and then start to deploy our required projects.

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.