Install nodejs 4 on redhat

Nodejs version 4 was released and installed on my Windows computer. I am trying to install a package using yum on redhat, but I am not getting the latest version.

I tried: sudo yum install -y nodejs , but the latest version 4.0 is not installed.

How to install nodejs 4.0 on a redhat machine?

+5
source share
5 answers

NodeJS 4.X for EL7 repositories located at https://rpm.nodesource.com/pub_4.x/el/7/

To install using yum change baseurl in the file nodeource-el.repo:

 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 
+5
source

You can compile and install from your source.

 ver=4.0.0 wget -c https://nodejs.org/dist/v$ver/node-v$ver.tar.gz #This is to download the source code. tar -xzf node-v$ver.tar.gz cd node-v$ver ./configure && make && sudo make install 

https://github.com/nodejs/node-v0.x-archive/wiki/Installation

+2
source

Try npm install n -g and then n latest to download it using this version manager.

Edit: Official distributions are managed by Nodesource . For RHEL it is assumed that the installation (take from the repo):

Current installation instructions listed in the Node.js Wiki :

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

Run as root on RHEL, CentOS, CloudLinux or Fedora:

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

Then install as root:

 yum install -y nodejs 

But keep in mind that 4.0 is currently not in your rpm schedule

+1
source

This was my solution, and it worked:

Distrubution url: Distr: https://nodejs.org/dist/v4.2.1/node-v4.2.1.tar.gz (currently v4.2.1)

Unpack the package (tar Jxf node -v4.2.1.tar.xz).

Some packages may be too old and may cause problems during installation. cd to the unzipped file and run "./configure". if the "warming" C ++ compiler is too old, you need g ++ 4.8 or clang ++ 3.4 ", you need to run the following commands:

 curl http://linuxsoft.cern.ch/cern/scl/slc6-scl.repo > /etc/yum.repos.d/slc6-scl.repo rpm --import http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern yum install -y devtoolset-3 

And to use it without having to set environment variables, run the following command:

 scl enable devtoolset-3 bash 

Now restart the process:

 ./configure make make install 
+1
source

You can try this solution.

First update the software repository to the latest versions:

 yum -y update 

Intall "Development Tools". This is a group of tools for compiling software from sources.

 yum -y groupinstall "Development Tools" 

Move to the / usr / src directory, the usual place to store the source software files.

 cd /usr/src 

Now we select the last archive with compressed source code from Node.js site http://nodejs.org/download/ .

 wget http://nodejs.org/dist/v4.2.4/node-v4.2.4.tar.gz tar zxf node-v4.2.4.tar.gz cd node-v4.2.4 ./configure make make install 
0
source

All Articles