CentOS6.8 install node.js npm

Environment: CentOS6.8_X64 system

  1. Go to the official website to download the latest compiled installation file, which is currently 6.9.4.
$>cd /usr/local/src #Locate this directory, the downloaded file will be in this directory
# Download using wget (this built-in command)
$>wget https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-x64.tar.xz
  1. Unzip the file and move the location
$>cd /usr/local/src #Navigate to this directory
$>tar xvf node-v6.9.4-linux-x64.tar.gz #Unzip the downloaded file to the current directory
$>mv node-v6.9.4-linux-x64 /usr/local/node  #Move the decompression purpose to the upper directory and rename it to node

Three, NODE environment configuration

If you want to use /usr/local/node in the global directory, you need to configure the global environment. The steps are as follows:

vi /etc/profile

# Add at the bottom
# node config 
export NODE_HOME=/usr/local/node
export PATH=$PATH:$NODE_HOME/bin  
export NODE_PATH=$NODE_HOME/lib/node_modules 

: wq (save and exit)

source /etc/profile  #Make the configuration file effective

Fourth, verify the installation.

Use node -v to check the installation. The node installation package comes with npm installation, so you can also use npm -v to see the installed version of npm

[ root@VM_118_34_centos ~]# node -v
v6.9.4[root@VM_118_34_centos ~]# npm -v
3.10.10

Recommended Posts

CentOS6.8 install node.js npm
CentOS install nodejs 8
Nodejs install on centos7
Install Node.js on Centos
ubuntu16.04 install node.js, npm
Centos6.9 install npm environment
How to install Node.js and npm on CentOS 8
1.5 Install Centos7
Install nodejs and npm under Ubuntu 16.04
Centos6 install Python2.7.13
CentOS7.2 install Mysql5.7.13
CentOS install Redmine
Centos7 install Python 3.6.
CentOS 7 install Docker
CentOS7 install GlusterFS
CentOS 7.4 install Zabbix 3.4
CentOS7 install Docker
Centos6.5 install Tomcat
CentOS install Python 3.6
Vmware install CentOS6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
Centos7 install Python2.7
ubuntu install nodejs
Centos 7.6 install seleniu
CentOS 7.3 install Zabbix3
Centos7 install LAMP+PHPmyadmin
CentOS install mysql
CentOS install openjdk 1.8
CENTOS6.5 install CDH5.12.1 (1)
CentOS install PHP
CentOS6 install mist.io
Centos7 install Docker
CentOS7 install mysql
centOs install rabbitMQ
CentOS 7 install MySQL 5.6
Centos7 install Nginx
CentOS6.5 install CDH5.13
Centos7 install docker18
Centos install Python3
centos7 install docker
CentOS install jdk
centos7 install nginx-rtmp
CentOS8 install MySQL8.0
Centos6.3 install KVM
CentOS install PostgreSQL 9.1
CentOS7 install mysql8
CentOS 7 install Java 1.8
CentOS8 install fastdfs6.06
CentOS 7 install Gitlab
Centos 7 install PostgreSQL
CentOS7 install MySQL8
CentOS 7 install Java 1.8
CentOS 6 install Docker
centos 6.5 install zabbix 4.4
Centos8 install Docker
CentOS6.8 install python2.7
CentOS6.5 install GNS3
centos 7.5 install mysql5.7.17
Centos7 install MySQL8.0-manual
CentOS7 install Kubernetes 1.16.3