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.