centos 6.5下面进行node的安装
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
成功则返回如下列表:
/etc/yum.repos.d/epel.repo
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/remi.repo
开启 remi 软件仓库
1
vi /etc/yum.repos.d/remi.repo
编辑[remi]下的enabled选项从0设为1
[remi]
...
enabled=1
...
OK,现在可以使用了。
如果运行yum 时,出现如下报错:
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
解决办法:
vi /etc/yum.repos.d/epel.repo
编辑[epel]下的baseurl前的#号去掉,mirrorlist前添加#号。正确配置如下:
[epel]
name=Extra Packages for Enterprise Linux 6 – $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
...
再运行
yum makecache
再次检查epel是否已经安装
1
yum repolist
返回软件仓库列表如下:
repo id repo name status
10gen 10gen Repository 274
base CentOS-6 - Base 6,575
epel Extra Packages for Enterprise Linux 6 - x86_64 11,836
extras CentOS-6 - Extras 48
remi Remi's RPM repository for Enterprise Linux 6 - x86_64 3,097
remi-safe Safe Remi's RPM repository for Enterprise Linux 6 - x86_64 534
rpmforge RHEL 6 - RPMforge.net - dag 4,718
updates CentOS-6 - Updates 958
repolist: 28,040
如果返回列表中包含 epel ,则说明你已成功安装。
最后,进行nodejs 和 npm 的安装:
1
yum install nodejs npm --enablerepo=epel
npm install -g n
n 0.8.11 (指定版本)
npm install cnpm -g --registry=https://registry.npm.taobao.org
npm install -g create-react-app
create-react-app my-app