如何在Amazon Linux上安装Node.JS [英] How to yum install Node.JS on Amazon Linux

查看:167
本文介绍了如何在Amazon Linux上安装Node.JS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过有关使用yum安装依赖项,然后安装Node.JS&的文章。 NPM来源。虽然这样做确实可行,但我觉得Node.JS和NPM都应该在公共仓库中。

I've seen the writeup on using yum to install the dependencies, and then installing Node.JS & NPM from source. While this does work, I feel like Node.JS and NPM should both be in a public repo somewhere.

如何在一个命令中安装Node.JS和NPM AWS Amazon Linux吗?

How can I install Node.JS and NPM in one command on AWS Amazon Linux?

推荐答案

偶然发现了这一点,后来又很难找到。后代放置在这里:

Stumbled onto this, was strangely hard to find again later. Putting here for posterity:

sudo yum install nodejs npm --enablerepo=epel

编辑3:自2016年7月起,编辑1 不再适用于nodejs 4(和编辑2 都没有)。这个答案( https://stackoverflow.com/a/35165401/78935 )提供了一个真正的单行代码。

EDIT 3: As of July 2016, EDIT 1 no longer works for nodejs 4 (and EDIT 2 neither). This answer (https://stackoverflow.com/a/35165401/78935) gives a true one-liner.

编辑1:如果您正在寻找nodejs 4,请尝试EPEL测试库:

EDIT 1: If you're looking for nodejs 4, please try the EPEL testing repo:

sudo yum install nodejs --enablerepo=epel-testing

编辑2:要使用上述命令从通过EPEL存储库安装的nodejs 0.12升级到EPEL测试存储库的nodejs 4,请按照以下步骤操作:

EDIT 2: To upgrade from nodejs 0.12 installed through the EPEL repo using the command above, to nodejs 4 from the EPEL testing repo, please follow these steps:

sudo yum rm nodejs
sudo rm -f /usr/local/bin/node
sudo yum install nodejs --enablerepo=epel-testing

更新的软件包将节点二进制文件放入 / usr / bin ,而不是 / usr / local / bin

The newer packages put the node binaries in /usr/bin, instead of /usr/local/bin.

还有一些背景:

选项-enablerepo = epel 会导致 yum 在EPEL存储库中搜索软件包。

The option --enablerepo=epel causes yum to search for the packages in the EPEL repository.


EPEL(Enterprise Linux的额外软件包)是Fedora团队的开源项目,是免费的基于社区的存储库项目,它为100%提供高质量的附加软件包。 Linux发行版,包括RHEL(红帽企业版Linux),CentOS和Scientific Linux。 Epel项目不是RHEL / Cent OS的一部分,但它通过提供许多开放源代码包(如网络,系统管理员,编程,监视等)而设计用于主要的Linux发行版。大部分epel软件包都由Fedora存储库维护。

EPEL (Extra Packages for Enterprise Linux) is open source and free community based repository project from Fedora team which provides 100% high quality add-on software packages for Linux distribution including RHEL (Red Hat Enterprise Linux), CentOS, and Scientific Linux. Epel project is not a part of RHEL/Cent OS but it is designed for major Linux distributions by providing lots of open source packages like networking, sys admin, programming, monitoring and so on. Most of the epel packages are maintained by Fedora repo.

通过 http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6- 5 /

这篇关于如何在Amazon Linux上安装Node.JS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆