Distributions: Node js package install for 7.x tries to install 6.9.5 for CentOS

Created on 16 Feb 2017  路  6Comments  路  Source: nodesource/distributions

It looks to be pointing at the wrong version.

using...
curl --silent --location https://rpm.nodesource.com/setup_7.x | bash -

... the following occurs for Centos7; with 6.9.5 already installed (and errors out if not):

[root@meta ~]# curl -sL https://rpm.nodesource.com/setup_7.x | bash -

## Installing the NodeSource Node.js 7.x repo...

## Inspecting system...

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

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

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_7.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.r9DrseAjR3' 'https://rpm.nodesource.com/pub_7.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Installing release setup RPM...

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

## Cleaning up...

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

## Checking for existing installations...

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

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

[root@meta ~]# yum install -y nodejs
Loaded plugins: fastestmirror, langpacks
Repository nodesource is listed more than once in the configuration
Repository nodesource-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirror.millry.co
 * epel: mirror.math.princeton.edu
 * extras: denver.gaminghost.co
 * updates: mirror.math.princeton.edu
Package 2:nodejs-6.9.5-1nodesource.el7.centos.x86_64 already installed and latest version
Nothing to do
[root@meta ~]# 

Thanks,
David

Most helpful comment

This would fix the problem

rm -f /etc/yum.repos.d/nodesource-el.repo
yum clean all
yum -y remove nodejs
yum -y install nodejs

According to https://github.com/nodesource/distributions/issues/191#issuecomment-310164174

See also: https://github.com/nodesource/distributions/issues/410#issuecomment-269919536

All 6 comments

Hrm, not immediately sure what's going on here. Did you previously have v6.x installed from our repositories? Also, can you let us know the output of:

[root@meta ~]# cat /etc/yum.repos.d/nodesource*

FYI, making sure that wasn't some weird quirk of the particular VM, I fired up a VM I knew nodejs hadn't been installed on; installed v7.5 and installed OK

Then I fired another up with no previous nodejs...

  • installed v6 - OK
  • installed v7 - it again tried to re-install v6.9.5, same messages as in previous post

re: Did you previously have v6.x installed from our repositories? Yes.

re: cat /etc/yum.repos.d/nodesource*

Not sure if it's normal but there are two nodesource entries in the directory

[root@meta ~]# ll /etc/yum.repos.d/nodesource*
-rw-r--r-- 1 root root 472 Oct 21 20:30 /etc/yum.repos.d/nodesource-el7.repo
-rw-r--r-- 1 root root 472 Apr 26 2016 /etc/yum.repos.d/nodesource-el.repo

... and here are contents...

[root@meta ~]# cat /etc/yum.repos.d/nodesource*
[nodesource]
name=Node.js Packages for Enterprise Linux 7 - $basearch
baseurl=https://rpm.nodesource.com/pub_7.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_7.x/el/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
gpgcheck=1
[nodesource]
name=Node.js Packages for Enterprise Linux 7 - $basearch
baseurl=https://rpm.nodesource.com/pub_6.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_6.x/el/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
gpgcheck=1
[root@meta ~]# 

It's midnight here, so off to bed - will check back in the (later) morning.

Thanks,
David

This would fix the problem

rm -f /etc/yum.repos.d/nodesource-el.repo
yum clean all
yum -y remove nodejs
yum -y install nodejs

According to https://github.com/nodesource/distributions/issues/191#issuecomment-310164174

See also: https://github.com/nodesource/distributions/issues/410#issuecomment-269919536

It's works for me @xxd3vin, thank you.

Closing.

Hi,

I had the same issue and your solution is the only one that works.

Thank you @xxd3vin !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SammariAhmed picture SammariAhmed  路  5Comments

thameemk612 picture thameemk612  路  3Comments

AJCStriker picture AJCStriker  路  5Comments

MichaelBitard picture MichaelBitard  路  4Comments

alexcleu picture alexcleu  路  3Comments