centos7安装npm和nodejs

    https://github.com/kazuhisya/nodejs-rpm


$ sudo curl -sL -o /etc/yum.repos.d/khara-nodejs.repo https://copr.fedoraproject.org/coprs/khara/nodejs/repo/epel-7/khara-nodejs-epel-7.repo
$ sudo yum install -y nodejs nodejs-npm
 

node.js RPM spec

BlanchStatusRPM
master (v7, Current)Circle CIFedoraCopr
v6.x (v6, LTS)Circle CIFedoraCopr
v4.x (v4, LTS)Circle CIFedoraCopr

Compiled Package

el7:

$ sudo curl -sL -o /etc/yum.repos.d/khara-nodejs.repo https://copr.fedoraproject.org/coprs/khara/nodejs/repo/epel-7/khara-nodejs-epel-7.repo
$ sudo yum install -y nodejs nodejs-npm

fc23, 24:

$ sudo dnf copr enable khara/nodejs
$ sudo dnf install -y nodejs nodejs-npm

Building the RPM

Distro support

Tested

  • RHEL/CentOS 7 x86_64
  • Fedora23, 24 x86_64

Probably it works

Prerequisites:

  • Python 2.7
  • gcc and g++ 4.8 or newer

Docker (el7, el6, el5)

Docker environment for building nodejs rpm. It will help to build and debug.

Build (el7, el6)

setting up:

$ sudo yum install -y yum-utils rpmdevtools make

git clone and make:

$ git clone https://github.com/kazuhisya/nodejs-rpm.git
# If you want to use other version, You can clone to specify the branch name.
# example: git clone -b v4.x https://github.com/kazuhisya/nodejs-rpm.git
$ cd nodejs-rpm
$ sudo yum-builddep ./nodejs.spec

el7:

$ make rpm

el6 : with Software Collections and Devtoolset

$ scl enable python27 devtoolset-3 'make rpm'

install package:

$ cd ./dist/RPMS/x86_64/
$ sudo yum install ./nodejs-X.X.X-X.el6.x86_64.rpm ./nodejs-npm-X.X.X-X.el6.x86_64.rpm --nogpgcheck

Build (el5)

el5 : with Devtoolset and python27

$ sudo yum install -y epel-release ius-release
$ sudo yum install -y yum-utils rpmdevtools buildsys-macros redhat-rpm-config tar make openssl-devel libstdc++-devel zlib-devel gzip 
$ sudo yum install -y devtoolset-2-gcc-c++ devtoolset-2-binutils python27
$ git clone https://github.com/kazuhisya/nodejs-rpm.git
$ cd nodejs-rpm
$ rpmdev-setuptree
$ curl -OLk https://nodejs.org/dist/vX.X.X/node-vX.X.X.tar.gz
$ cp *.patch ~/rpmbuild/SOURCES/ ; cp *.md ~/rpmbuild/SOURCES/ ; cp *.tar.gz ~/rpmbuild/SOURCES/ 
$ scl enable devtoolset-2 'rpmbuild -ba ./nodejs.spec'

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值