默认的,通过
yum install -g nodejs 安装 nodejs 为 0.1x 版本的。
如果需要其他版本,则需要指定 nodejs 源。
6.x
- curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
5.x
- curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
4.x
- curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
0.1x
- curl --silent --location https://rpm.nodesource.com/setup | bash -
指定 6.x 版本以后,如下提示,表示成功
- + rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
- + uname -m
- + curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_6.x/el/6/x86_64/nodesource-release-el6-1.noarch.rpm'
- + mktemp
- + curl -sL -o '/tmp/tmp.CQ0Pv3MA10' 'https://rpm.nodesource.com/pub_6.x/el/6/x86_64/nodesource-release-el6-1.noarch.rpm'
- + rpm -i --nosignature --force '/tmp/tmp.CQ0Pv3MA10'
- + rm -f '/tmp/tmp.CQ0Pv3MA10'
- + rpm -qa 'node|npm' | grep -v nodesource
然后执行全局安装
完毕!
评论 (0)