Download the appropriate version first. I'm using node v.10.36 here.
The detailed procedures for compiling the installation are described first.
Download this version:
wget http://nodejs.org/dist/v0.10.36/node-v0.10.36-linux-x64.tar.gz
Unzip:
tar XF node-v0. 10.36-linux-x64. tar. gz
#更改目录名称 MV Node-v0. 10.36-linux-x64 nodejs# move to the specified directory mv nodejs/data//data/nodejs/set Soft links LN -s/data/nodejs/bin/node/usr/local/bin/nodeLN -s/data/nodejs/bin/npm/usr/local/bin/ Npm
To view the version of node that is currently installed:
Node-v
By the time this compilation is installed, you will install some third-party libraries:
Install -G node-gyp Async Machina Express express-session ejs body-parser cookie-parser connect-busboy Debug PA Ssport passport-local flags Log4js Morgan MongoDB Redis protobufjs nodejs-websocket CRC Serve-favicon Socket.io
Of course, the installation is optional according to your situation.
The following is a description of how Yum is installed.
#搜索一下系统是否有nodejs Yum Search Nodejs
If there is, you can install, in general, the system comes with a lower version, you can choose Yum.repo Way to install.
Create a new file Epel.repo in the/etc/yum.repos.d/directory (if present, update)
1 [Epel]2Name=extra Packages forEnterprise Linux6-$basearch3Baseurl=http://mirrors.aliyun.com/epel/6/$basearch4http//mirrors.aliyuncs.com/epel/6/$basearch5#mirrorlist =https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch= $basearch6Failovermethod= Priority7Enabled=18gpgcheck=09gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-epel-6Ten One[epel-Debuginfo] AName=extra Packages forEnterprise Linux6-$basearch-Debug -Baseurl=http://mirrors.aliyun.com/epel/6/$basearch/debug -http//mirrors.aliyuncs.com/epel/6/$basearch/debug the#mirrorlist =https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch= $basearch -Failovermethod= Priority -Enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-epel-6 +gpgcheck=0 - +[epel-Source] AName=extra Packages forEnterprise Linux6-$basearch-Source atBaseurl=http://Mirrors.aliyun.com/epel/6/srpms -http//Mirrors.aliyuncs.com/epel/6/srpms -#mirrorlist =https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch= $basearch -Failovermethod= Priority -Enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-epel-6 ingpgcheck=0
Save again after Yum
#清理一下: Yum Clean all# and then install Nodejs: Yum Install -V
NODEJS installation process under Linux system