在Red Hat Enterprise Linux 7.1的远程AWS实例上安装NODEJS

Dan*_*Dan 7 javascript linux amazon-web-services node.js

我一直在尝试在Red Hat Enterprise Linux 7.1的远程AWS实例上安装NODEJS

我在这里阅读了一些帖子,并在节点js网站上

我试过了

curl --silent --location https://rpm.nodesource.com/setup | bash -
Run Code Online (Sandbox Code Playgroud)

但后来得到了错误

错误:无法在/var/lib/rpm/.rpm.lock上创建事务锁定(权限被拒绝)

如果我跑,我甚至会得到这个错误

sudo curl --silent --location https://rpm.nodesource.com/setup | bash -
Run Code Online (Sandbox Code Playgroud)

我也尝试更改该文件的权限,但它仍然没有安装

有人可以提出更好的方式/正确的方法吗?

谢谢

Eds*_*lho 25

您只是没有权限安装东西.使用sudo运行curl并不重要,因为真正需要超级用户权限的是运行脚本的bash会话.

所以,这会奏效.

curl --silent --location https://rpm.nodesource.com/setup | sudo bash -
Run Code Online (Sandbox Code Playgroud)


小智 1

至少在我们的一台 ESXi RedHat 虚拟机上,我知道安装 Nodejs 的最简单方法是:

    yum install epel-release
    yum install nodejs
Run Code Online (Sandbox Code Playgroud)

让百胜来完成所有繁重的工作:)