Let's take a look at how to compile the installation through the source code
1, install the dependent package
[root@1c3b4a5a8f31 ~]# yum -y install gcc gcc-c++ openssl-devel
2, download the source package
[Root@1c3b4a5a8f31 ~]# wget http://www.nodejs.org/dist/latest/node-v0.12.5.tar.gz
[root@1c3b4a5a8f31 ~]# Tar- ZXVF node-v0.12.5.tar.gz
[root@1c3b4a5a8f31 ~]# CD node-v0.12.5
3, configuration, compilation, installation
[Root@1c3b4a5a8f31 ~]#./configure--prefix=/usr/local/node
[root@1c3b4a5a8f31 ~]# make && make install
4. Configure NODEJS Environment
[Root@1c3b4a5a8f31 ~]# vim/etc/profile
#set nodejs env
export node_home=/usr/local/node
export path=$ Node_home/bin: $PATH
export node_path= $NODE _home/lib/node_modules: $PATH
[root@1c3b4a5a8f31 ~]# source/etc/ Profile #重启生效
5. Test whether the installation is successful
[Root@1c3b4a5a8f31 ~]# node-v
v0.12.5
[root@1c3b4a5a8f31 ~]# npm-v-2.11.2
and see how to install it through Yum.
Install Node.js
Landing CentOS
Terminal login $ ssh root@192.168.0.23 IP can be within the LAN or public network IP.
Download node
According to your system, find https://nodejs.org/en/download/in the website you need to download the version. For example, I choose the Linux Binaries (x86/x64) 64bit, right click on the version you need to copy the address, through the command download Nodejs install compression package.
$ wget https://nodejs.org/dist/v4.4.4/node-v4.4.4-linux-x64.tar.xz
If you wget command does not exist, you can install the download tool wget by yum install wget command. If you are the smallest version of the CentOS need to be installedyum -y install gcc make gcc-c++ openssl-devel wget
Decompression Installation
# No use of ' gzip ' compression remove ' z ' parameter
$ sudo tar--strip-components 1-xzvf node-v*-c/usr/local
View Installation
You can see if the installation was successful! General installation will be reported error messages, if no error message, you can call the node command to test the success of the installation!
NODE-V # will output version information
# v6.9.1
npm-v # will output version information
# 3.10.8
Finally, let's take a look at NPM to install
Step1.
Enter http://nodejs.org/dist/Download the required version of the Node.js
(for example, current version of the latest link http://nodejs.org/dist/v0.12.7/, download node-v0.12.7-linux-x64.tar.gz)
Step2.
Extract:tar –xf node-v0.12.7-linux-x64.tar.gz
Configure environment variables (add bin under node to environment variables)
Step3. (using Express Application Builder)
Perform:npm install express-generator –g
After the end will be prompted the following content.
Step4.
Follow the prompts to execute the command CD test
Then you can do NPM start.
can open browser, address bar input localhost:3000