This article mainly introduces Node. js getting started Tutorial: install and configure Node on windows and Linux. the js method is illustrated in the following illustration. The detailed steps are to learn how to install node. js is an excellent tutorial. For more information about how to install Node on Windows and Linux, see the following section. js method.
This tutorial uses Node. js v0.10.26 as an example.
The Node. js installation package and source code are: http://www.nodejs.org/download /.
Select the Node. js installation package you need based on different platform systems.
Note:To install Node. js on Linux, Python 2.6 or 2.7 is required. We do not recommend that you install Python 3.0 or later.
Install Node. js on ipvwv
Windows Installation Package (. msi):
32-bit installation package: http://nodejs.org/dist/v0.10.26/node-v0.10.26-x86.msi
64-bit installation package: http://nodejs.org/dist/v0.10.26/x64/node-v0.10.26-x64.msi
Installation steps:
Step 1: double-click the downloaded installation package node-v0.10.26-x86.msi, as shown below:
Step 2: Click Run. The following page is displayed:
Step 3: select the accept protocol option and click next:
Step 4: The default installation directory of Node. js is "C: \ Program Files \ nodejs \". You can modify the Directory and click next (next ):
Step 5: Click the tree icon to select the desired installation mode, and then click next (next)
Step 6: Click Install to Install Node. js. You can also click Back to modify the previous configuration. Then click next ):
Installation Process:
Click Finish to exit the installation wizard.
Check whether Node. js is configured for the PATH environment variable. Click Start = run = and enter "cmd" => enter the command "path". The following result is output:
The Code is as follows:
PATH = C: \ oraclexe \ app \ oracle \ product \ 10.2.0 \ server \ bin; C: \ Windows \ system32; 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 Server 5.5 \ bin; C: \ Program Files \ nodejs \; C: \ Users \ rg \ AppData \ Roaming \ npm
We can see that the environment variable contains C: \ Program Files \ nodejs \
Check the Node. js version
Install Windows binary file (.exe):
32-bit installation package: http://nodejs.org/dist/v0.10.26/node.exe
64-bit installation package: http://nodejs.org/dist/v0.10.26/x64/node.exe
Installation Steps
Step 1: double-click the downloaded installation package Node.exe. The following page is displayed:
Click Run to display the command line window:
Version Test
Enter the directory where node.exe is located, as shown below:
If you obtain the preceding output, you have successfully installed Node. js.
Install Node. js Ubuntu on Linux
The following section describes how to install Node. js in Ubuntu Linux. For other Linux systems, such as Centos, follow these steps.
Get the Node. js source code on Github:
After the download is complete, change the source package name to 'node '.
Modify directory permissions:
Use './configure' to create a compilation file.
Compile: make.
Complete the installation: make install.
Finally, run the 'node -- version' command to check whether node. js is successfully installed.
Install nodejs in centOS
1. Download the source code. download the latest nodejsrepository at http://nodejs.org/. this document uses v0.10.24as an example:
The Code is as follows:
Cd/usr/local/src/wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
2. decompress the source code
The Code is as follows:
Tar zxvf node-v0.10.24.tar.gz
3. Compile and install
The Code is as follows:
Cd node-v0.10.24./configure -- prefix =/usr/local/node/0.10.24makemake install
4. Configure NODE_HOME and enter the profile to edit the environment variable.
The Code is as follows:
Vim/etc/profile
Set the nodejs environment variable inExport PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROLAdd the following content to a row:
The Code is 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 the configuration take effect.
The Code is as follows:
Source/etc/profile
Verify whether the configuration is successfully installed
The Code is as follows:
Node-v
V0.10.24 indicates that the configuration is successful.
Npm module installation path
The Code is as follows:
/Usr/local/node/0.10.24/lib/node_modules/
Note:The official node. js website provides compiled Linux Binary packages. You can download them and apply them directly.