Centos用yum方式安装nodejs和npm

时间:2023-04-24 19:02:56

要通过 yum 来安装 nodejs 和 npm 需要先给 yum 添加 epel 源

##添加 epel 源

rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

导入 key:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-

##添加 remi 源

rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-remi

安装完成后,执行

curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
yum -y install nodejs

原文:http://blog.csdn.net/xiao_jun_0820/article/details/50838185

yum和源码安装

https://blog.csdn.net/abcdefg2343/article/details/81355002