Node.js installation configuration
This chapter we will introduce you to install Node.js on a window and Linux method.
This installation tutorial Node.js v4.4.3 LTS (Long Term Support) version, for example.
Node.js installation package and source code download at: https://nodejs.org/en/download/ .
You can choose the package you need to install Node.js depending on platform.
Node.js version history Download: https://nodejs.org/dist/
Note: Install Node.js need to install on Linux Python 2.6 or 2.7, is not recommended to install Python 3.0 or later.
Node.js installation on Window
You can use the following two ways to install.
1, Windows installation package (.msi)
32-bit installation package Download: https://nodejs.org/dist/v4.4.3/node-v4.4.3-x86.msi
64-bit installation package Download: https://nodejs.org/dist/v4.4.3/node-v4.4.3-x64.msi
In the examples herein v0.10.26 version, for example, similar to other versions, the installation steps:
Step 1: Double-click the downloaded installation package v0.10.26, as follows:
Step 2: Click the above Run (Run), the following interface:
Step 3: Select the option to accept the agreement, click next (Next) button:
Step 4: Node.js default installation directory is "C: \ Program Files \ nodejs \", you can modify the directory, and click next (next):
Step 5: Click the tree icon to select the mode you need to install, and then click Next next (Next)
Step 6: Click Install (install) to start the installation Node.js. You can also click Back (Back) to modify the previous configuration. And then click next (next):
Installation process:
Click Finish (complete) button to exit the installation wizard.
Detection PATH environment variable is configured with Node.js, click Start = "run =" enter "cmd" => Enter the command "path", the following output:
PATH=C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Windows\system32; C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\; c:\python32\python;C:\MinGW\bin;C:\Program Files\GTK2-Runtime\lib; C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files\nodejs\; C:\Users\rg\AppData\Roaming\npm
We can see the environment variable already contains C: \ Program Files \ nodejs \
Check Node.js version
2, Windows binaries (.exe) installation
32-bit installation package Download: http://nodejs.org/dist/v0.10.26/node.exe
64-bit installation package Download: http://nodejs.org/dist/v0.10.26/x64/node.exe
installation steps
Step 1: Double-click the downloaded installation package Node.exe, the following interface will appear:
Command-line window, click Run (Run) button will appear:
Test version
Enter node.exe where the directory, as follows:
If you get the above output, indicating that you have successfully installed Node.js.
Ubuntu is installed Node.js
Node.js installation source
The following section describes how to install Node.js we will under Ubuntu Linux. Other Linux systems, such as Centos, etc. similar to the following installation steps.
Get Node.js source on Github:
$ sudo git clone https://github.com/nodejs/node.git Cloning into 'node'...
Modify directory permissions:
$ sudo chmod -R 755 node
Use./configure create the compiled file and follow:
$ cd node $ sudo ./configure $ sudo make $ sudo make install
View node version:
$ node --version v0.10.25
Ubuntu apt-get command to install
Command format is as follows:
sudo apt-get install nodejs sudo apt-get install npm
CentOS installed Node.js
1, download the source code, you need to https://nodejs.org/en/download/ download the latest version Nodejs, paper v0.10.24 example:
cd /usr/local/src/ wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
2, extract the source
tar zxvf node-v0.10.24.tar.gz
3, compile and install
cd node-v0.10.24 ./configure --prefix=/usr/local/node/0.10.24 make make install
4, configuration NODE_HOME, enter profile editing environment variables
vim /etc/profile
Nodejs set environment variables, add the following in the aboveexport PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROLline:
#set for nodejs export NODE_HOME=/usr/local/node/0.10.24 export PATH=$NODE_HOME/bin:$PATH
: Wq to save and exit, the compiler / etc / profile to validate the configuration
source /etc/profile
Verify successful installation configuration
node -v
Output configuration is successful v0.10.24
npm module installation path
/usr/local/node/0.10.24/lib/node_modules/
NOTE: Nodejs official website provides precompiled Linux binaries, you can download it directly.