Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Node .js installation configuration


May 10, 2021 Node.js


Table of contents


Node .js installation configuration

In this section, we'll show you how to install Node and .js and Linux.

This installation tutorial is an example .js version of Node v0.10.26.

Node .js installation package and source download address is: http://www.nodejs.org/en/download/.

Node .js installation configuration

Choose the Node installation package you need based on .js platform system.

Note: Installing Node .js on Linux requires Python 2.6 or 2.7, and Python 3.0 or more is not recommended.


Node is installed on Windowv.js

Windows installation 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 on the downloaded installation package node-v0.10.26-x86.msi, as follows:

Node .js installation configuration

Step 2: Click run above and the following interface will appear:

Node .js installation configuration

Step 3: Check the Accept Agreement option and click the next button:

Node .js installation configuration

Step 4: Node .js the default installation directory is "C:\Program Files\nodejs", you can modify the directory and click next:

Node .js installation configuration

Step 5: Click on the tree icon to select the installation mode you need, then click Next

Node .js installation configuration

Step 6: Click Install to start installing the Node .js. Y ou can also click Back to modify the previous configuration. T hen click next:

Node .js installation configuration

Installation process:

Node .js installation configuration

Click the Finish button to exit the installation wizard.

Node .js installation configuration

To detect if the PATH environment variable is configured with Node.js, click Start, Run, enter "cmd" and enter the command "path" and output the following results:

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 C:\Program Files\nodejs

Check the version .js Node

Node .js installation configuration

Windows binary (.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 on the downloaded installation package Node .exe and the following interface will appear:

Node .js installation configuration

Clicking the Run button will appear in the command line window:

Node .js installation configuration

version testing

Go to .exe directory where node is located, as follows:

Node .js installation configuration

If you get the output above, you have successfully installed .js.


The Node device is installed on Linux.js

Ubuntu source installation

The following sections describe how to install Node under Ubuntu Linux .js. O ther Linux systems, such as Centos, have similar installation steps.

Get the node source code .js Github:

Node .js installation configuration Node .js installation configuration

After the download is complete, change the source package name to 'node'.

Node .js installation configuration

Modify directory permissions:

Node .js installation configuration

Create a compilation file using './configure'.

Node .js installation configuration

Compiled: make.

Node .js installation configuration

Complete installation: make install.

Node .js installation configuration

Finally, let's enter the 'node--version' command to see if .js the node is successfully installed.

Node .js installation configuration

The Ubuntu apt-get command is installed

The command format is as follows:

sudo apt-get install nodejs
sudo apt-get install npm

Install nodejs under centOS

1, download the source code, you need to http://nodejs.org/ the latest version of Nodejs, this article v4.5.0 as an example:

cd /usr/local/src/
wget http://nodejs.org/dist/v4.5.0/node-v4.5.0.tar.gz

2, decompression source code

tar zxvf node-v4.5.0.tar.gz

3, compilation and installation

cd node-v4.5.0
./configure --prefix=/usr/local/node/4.5.0
make
make install

4, configuration NODE_HOME, into the profele editing environment variables

vim /etc/profile

Set the nodejs environment variable and add the following on the line of export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL:

#set for nodejs
export NODE_HOME=/usr/local/node/4.5.0
export PATH=$NODE_HOME/bin:$PATH

:wq save and exit, compile/etc/profile makes the configuration effective

source /etc/profile

Verify that the installation configuration was successful

node -v

Output v4.5.0 indicates a successful configuration

The npm module installation path

/usr/local/node/4.5.0/lib/node_modules/

Note: Nodejs website provides compiled Linux binary packages that you can also download and apply directly.