文档章节

How to install Nodejs in centos

Bob_Zheng
 Bob_Zheng
发布于 2015/11/20 19:24
字数 539
阅读 56
收藏 0

Including Red Hat® Enterprise Linux® / RHEL, CentOS and Fedora.

Node.js is available from the NodeSource Enterprise Linux and Fedora binary distributions repository. Support for this repository, along with its scripts, can be found on GitHub at nodesource/distributions.

Note that the Node.js packages for EL 5 (RHEL5 and CentOS 5) depend on the EPEL repository being available. The setup script will check and provide instructions if it is not installed.

Run as root on RHEL, CentOS or Fedora:

curl --silent --location https://rpm.nodesource.com/setup | bash -

Then install, as root:

yum -y install nodejs

Including Red Hat® Enterprise Linux® / RHEL, CentOS and Fedora.

Node.js is available from the NodeSource Enterprise Linux and Fedora binary distributions repository. Support for this repository, along with its scripts, can be found on GitHub at nodesource/distributions.

Note that the Node.js packages for EL 5 (RHEL5 and CentOS 5) depend on the EPEL repository being available. The setup script will check and provide instructions if it is not installed.

Run as root on RHEL, CentOS or Fedora:

curl --silent --location https://rpm.nodesource.com/setup | bash -

Then install, as root:

yum -y install nodejs



[root@eel220825 bin]# sudo yum install nodejs npm --enablerepo=epel
Loaded plugins: fastestmirror, refresh-packagekit, security


Error getting repository data for epel, repository not found
[root@eel220825 bin]# sudo yum install nodejs npm --enablerepo=epel
Loaded plugins: fastestmirror, refresh-packagekit, security


Error getting repository data for epel, repository not found
[root@eel220825 bin]# curl --silent --location https://rpm.nodesource.com/setup | bash -

## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release
+ uname -m

## Confirming "el6-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub/el/6/x86_64/nodesource-release-el6-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.neTNsKUQ7v' 'https://rpm.nodesource.com/pub/el/6/x86_64/nodesource-release-el6-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.neTNsKUQ7v'

## Cleaning up...

+ rm -f '/tmp/tmp.neTNsKUQ7v'

## Checking for existing installations...

+ rpm -qa 'node|npm' | grep -v nodesource

## Run `yum install -y nodejs` (as root) to install Node.js and npm.
## You may also need development tools to build native addons:
##   `yum install -y gcc-c++ make`

[root@eel220825 bin]# yum -y install nodejs
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.nwsuaf.edu.cn
 * extras: mirrors.nwsuaf.edu.cn
 * updates: mirrors.nwsuaf.edu.cn
nodesource                                               | 2.5 kB     00:00     
nodesource/primary_db                                    |  17 kB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 0:0.10.40-1nodesource.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package      Arch         Version                       Repository        Size
================================================================================
Installing:
 nodejs       x86_64       0.10.40-1nodesource.el6       nodesource       4.6 M

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 4.6 M
Installed size: 16 M
Downloading Packages:
nodejs-0.10.40-1nodesource.el6.x86_64.rpm                | 4.6 MB     00:36     
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID 34fa74dd: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
Importing GPG key 0x34FA74DD:
 Userid : NodeSource <gpg-rpm@nodesource.com>
 Package: nodesource-release-el6-1.noarch (installed)
 From   : /etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : nodejs-0.10.40-1nodesource.el6.x86_64                        1/1
  Verifying  : nodejs-0.10.40-1nodesource.el6.x86_64                        1/1

Installed:
  nodejs.x86_64 0:0.10.40-1nodesource.el6                                       

Complete!
[root@eel220825 bin]#

© 著作权归作者所有

Bob_Zheng
粉丝 4
博文 56
码字总数 8727
作品 0
珠海
私信 提问
Linux下安装最新NodeJS开发环境

Ubuntu 和Debian以及CentOS这些内置源的NodeJS的版本和官方最新版差了个爷爷辈,所以需要安装新版的NodeJS要么去官方下包解压手动安装,要么找源进行安装。 本着方便的原则,当然是一键自动安...

Swire
2017/09/28
347
0
[转]CentOS安装NodeJS

CentOS安装NodeJS 在CentOS下安装NodeJS有以下几种方法。使用的CentOS版本为7.2。CentOS其他版本的NodeJS安装大同小异,也可以参看本文的方法。 安装方法1——直接部署 1.首先安装wget yum ...

致学无忧
02/12
0
0
Centos7安装Node.js

官网安装说明: 链接 Enterprise Linux (RHEL and CentOS) users may use the Node.js and npm packages from the EPEL repository. Install the appropriate epel-release RPM for your ve......

煲煲菜
09/29
0
0
ubuntu 16.04 安装nodejs

经过几天的尝试,终于装好了: 1. nodejs官方推荐一下安装方式: NodeSource的二进制安装脚本NodeSource Using Ubuntu 试了,不行,然后terminal提示我用:apt install nodejs 2. nvm 切换用...

蜗牛奔跑
2016/12/20
94
1
CentOS上安装Node.js

CentOS上安装Node.js(想在Linux上学习Node.js的可以来看看)。 说明: 使用CentOS系统,进行nodejs安装,nodejs版本-v0.8.7。 1,先下载nodejs: # wget http://nodejs.org/dist/v0.8.7/node-...

lisn
2015/02/13
112
0

没有更多内容

加载失败,请刷新页面

加载更多

JavaScript权威指南笔记14

第14章、window对象 1、计时器 I-1 setTimeout()和setInterval()可在指定时间后调用 setTimeout()返回值可传递给clearTimeout()用于取消该函数的执行。 多久后执行。 setInterval()指定时间间...

_Somuns
22分钟前
3
0
python3.7安装教程

原创 python3.7安装教程 2018-09-18 21:10:56 PtaQ 阅读数 20628更多 分类专栏: python 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 本文...

_纵横捭阖_
34分钟前
3
0
windows使用docker运行mysql等工具(二)安装运行mysql

今天接着上一篇的内容继续来学习安装运行mysql。建议先阅读第一篇:windows安装docker 一 查看mysql版本 如果想知道mysql镜像具体有哪几个版本,需要去docker hub查看。 地址如下: https://...

执偕
44分钟前
4
0
IT兄弟连 HTML5教程 CSS3属性特效 文字排版

direction定义文字排列方式,所有浏览器都兼容这个属性,有两个可选值rtl和ltr。文字排版的参数说明如表1所示。 表1 CSS3文字排版参数说明 上表所示,ltr是初始值,表示left-to-right,就是从...

老码农的一亩三分地
44分钟前
2
0
做好一名linux运维工程师

如何做好一个合格的运工程师,运维工程师前景怎么样呢?就这些问题,与大家交流一下。首先对于运维工程师的要求是十分严苛的了,运维工程师不但要针对不同的问题做出响应,而且需要不断的补充...

问题终结者
45分钟前
5
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部