Cenos安装nodejs和npm
安装依赖
~# yum install -y gcc gcc-c++ make cmake autoconf automake libpng-devel libjpeg-devel libtiff-devel jasper-devel freetype-devel openssl-devel
安装remi 软件仓库
~# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
~# wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
~# rpm -ivh epel-release-6-8.noarch.rpm
~# rpm -ivh remi-release-6.rpm
查看状态
~# ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo
开启 remi 软件仓库
~# vi /etc/yum.repos.d/remi.repo
编辑[remi]下的enabled选项从0设为1
[remi]
…
enabled=1
…
查看安装状态
~# yum repolist
安装nodejs和nodejs依赖管理软件npm
~# yum install nodejs npm --enablerepo=epel
查看安装状态
~# node -v
v6.6.0
~# npm -v
3.10.3
OK, 大功告成!