Before you continue with node. js, you should be aware of some basic computer programming terminology. If you have studied JavaScript (ES6), Java and other programming languages, it will help you learn more about node. JS programming.
This installation takes the node. js v4.4.3 LTS (long-term supported version) version as an example.
The node. JS installation package and source code are: https://nodejs.org/en/download/.
You can choose the node. JS installation package you need based on different platform systems.
Node. js Historical version: https://nodejs.org/dist/
Note: Installing node. js on Linux requires Python 2.6 or 2.7, and it is not recommended to install Python 3.0 or later.
Install node. js on Window
You can use the following two ways to install.
1. Windows installation package (. msi)
32-bit installation package: Https://nodejs.org/dist/v4.4.3/node-v4.4.3-x86.msi
64-bit installation package: Https://nodejs.org/dist/v4.4.3/node-v4.4.3-x64.msi
For example, in the v0.10.26 version of this article, the other versions are similar, installation steps:
Step 1: Double-click the downloaded installation package v0.10.26as follows:
Step 2: Click on the run above, the following screen will appear:
Step 3: Tick the Accept Agreement option and click the Next button:
Step 4:node.js The default installation directory is "C:\Program files\nodejs\", you can modify the directory and click Next:
Step 5: Click the tree icon to select the installation mode you want, then click Next Step Next (next)
Step 6: Click 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.
To detect if the PATH environment variable is configured with node. js, click start = "Run =" Enter "cmd" + = Enter the command "path" and output the following result:
PATH=C:\oraclexe\app\oracle\product\10.2.0\server\bInch;C:\Windows\System32;C:\ windows;C:\windows\system32\wbem;C:\windows\system32\windowspowershell\v1.0\;c:\python32\pythonc:\mingw\bin;:\program files\gtk2 -runtime\lib;:\program files\mysql\mysql server 5.5\binc:\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
2. Windows binaries (. exe) installation
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 on the downloaded installation package Node.exe, the following interface will appear:
Clicking the Run button will show the command-line window:
Version test
Enter the directory where the Node.exe is located, as follows:
If you get the above output, you have successfully installed node. js.
Install Node.jsNode.js source installation on Ubuntu
The following section describes the installation of node. js under Ubuntu Linux. Other Linux systems, such as CentOS, are similar to the following installation steps.
Get the node. JS source code on Github:
$ sudo git clone https://github.com/nodejs/node.gitcloninginto' node ' ...
Modify Directory Permissions:
-755 node
Use ./configure to create the compiled file and follow:
./configure$ sudo make$ sudo make install
To view the node version:
--versionv0. 10.25
Ubuntu apt-get Command Installation
The command format is as follows:
sudo apt-get install Nodejssudo apt-get install npm
Install node. js under CentOS
1, download the source code, you need to download the latest Nodejs version in https://nodejs.org/en/download/, this article takes v0.10.24 as an example:
/usr/local/src/wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
2. Extracting source code
Tar zxvf node-v0. 10.24. Tar. GZ
3. Compile and install
CD node-v0. 10.24./--prefix=/usr/local/node/0.10. makemake Install
4, configure Node_home, enter the profile edit environment variable
/etc/ profile
Set the NODEJS environment variable to add the following on the export PATH USER LOGNAME MAIL HOSTNAME histsize histcontrol Line:
#set for Nodejsexport node_home=/usr/local/NODE/0.10. export PATH=$NODE _home/bin:$PATH
: Wq Save and exit, compile/etc/profile make configuration effective
/etc/ profile
Verify that the installation configuration is successful
-v
Output v0.10.24 indicates a successful configuration
NPM Module Installation Path
/usr/local/node/0.10. /Lib/node_modules/
Note:The NODEJS website provides a compiled Linux binary package that you can also download and apply directly.
node. JS installation Configuration