Nodejs 版本 4 已经发布并安装在我的 Windows 机器上。 我正在尝试通过 yum 在 redhat 上安装软件包,但我没有获得最新版本。
我试过:sudo yum install -y nodejs
但没有安装最新的 4.0 版本。
如何在 redhat 机器上安装 nodejs 4.0?
最佳答案
用于 EL7 存储库的 NodeJS 4.X 位于 https://rpm.nodesource.com/pub_4.x/el/7/
要使用 yum 安装,请将 nodesource-el.repo 文件中的 baseurl 更改为:
baseurl=https://rpm.nodesource.com/pub_4.x/el/7/$basearch
/etc/yum.repos.d/nodesource-el.repo
内容:
[nodesource]
name=Node.js Packages for Enterprise Linux 7 - $basearch
baseurl=https://rpm.nodesource.com/pub_4.x/el/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
[nodesource-source]
name=Node.js for Enterprise Linux 7 - $basearch - Source
baseurl=https://rpm.nodesource.com/pub_4.x/el/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
gpgcheck=1
关于linux - 在 redhat 上安装 nodejs 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32561962/