In this section we will show you how to install Node.js on Windows and Linux.
This installation tutorial takes the Node.js v0.10.26 version as an example.
Node.js installation package and the source code download address: http://www.nodejs.org/download/.
Choose the Node.js installation package you need according to the different platform system.
Note: Installing Node.js on Linux requires the installation of Python 2.6 or 2.7, and it is not recommended to install Python version 3.0 or above.
Install Node.js on WINDOWV
Windows Installer package (. msi) :
32-bit installation package download address: Http://nodejs.org/dist/v0.10.26/node-v0.10.26-x86.msi
64-bit installation package download address: Http://nodejs.org/dist/v0.10.26/x64/node-v0.10.26-x64.msi
Installation steps:
Step 1: Double-click the download installation package Node-v0.10.26-x86.msi, as follows:
Step 2: Click the run above and the following interface will appear:
Step 3: Check accept the Agreement option, click Next (Next) button:
Step 4:node.js The 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 installation mode you want, and then click Next (Next)
Step 6: Click Install (Install) to start installing Node.js. You can also click Back to modify the previous configuration. And then click Next (Next):
Installation process:
Click the Finish button to exit the Setup wizard.
Detect whether the PATH environment variable is configured with Node.js, click start = "Run =" Enter "cmd" => input Command "path", output the following results:
Copy Code code as follows:
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 that the environment variable already contains the C:\Program files\nodejs\
Check the Node.js version
Windows binary file (. exe) installation :
32-bit installation package download address: Http://nodejs.org/dist/v0.10.26/node.exe
64-bit installation package download address: Http://nodejs.org/dist/v0.10.26/x64/node.exe
Installation steps
Step 1: Double-click the download installation package Node.exe and the following interface will appear:
Clicking the Run button will show the Command line window:
Version test
Enter the directory where Node.exe is located, as follows:
If you get the above output, you have successfully installed the node.js.
Install Node.js Ubuntu installation on Linux
In the following sections we will describe installing Node.js under Ubuntu Linux. Other Linux systems, such as CentOS, are similar to the following installation steps.
Get the Node.js source on the Github:
After the download is complete, change the source package name to ' node '.
To modify directory permissions:
Use './configure ' to create a compiled file.
Compile: Make.
Complete installation: Make install.
Finally, we enter the ' node--version ' command to see if the Node.js is successfully installed.
Install Nodejs under CentOS
1, download the source code, you need to download the latest Nodejs version in http://nodejs.org/, this article take v0.10.24 as an example:
Copy Code code as follows:
Cd/usr/local/src/wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
2, extract the source code
Copy Code code as follows:
Tar zxvf node-v0.10.24.tar.gz
3. Compile and install
Copy Code code as follows:
CD node-v0.10.24./configure--prefix=/usr/local/node/0.10.24makemake Install
4, configure Node_home, enter profile edit environment variable
Copy Code code as follows:
Set the NODEJS environment variable to add the following on the export PATH USER LOGNAME MAIL HOSTNAME histsize histcontrol Line:
Copy Code code as follows:
#set for Nodejsexport node_home=/usr/local/node/0.10.24export path= $NODE _home/bin: $PATH
: Wq Save and exit, compile/etc/profile to make configuration effective
Copy Code code as follows:
Verify that the configuration was successfully installed
Copy Code code as follows:
Output v0.10.24 indicates a successful configuration
NPM Module Installation Path
Copy Code code as follows:
/usr/local/node/0.10.24/lib/node_modules/
Note: NODEJS Official website provides the compilation good Linux binary package, you also may download the direct application.