nodesource / distributions

NodeSource Node.js Binary Distributions

Home Page:https://nodesource.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node 5 installer on Centos7 tries to use 4.x package during yum install

MaffooBristol opened this issue · comments

Using setup_5.x tries to find the package nodejs-4.2.3-1nodesource.el7.centos.x86_64 from the URL https://rpm.nodesource.com/pub_5.x/el/7/x86_64/nodejs-4.2.3-1nodesource.el7.centos.x86_64.rpm, which obviously 404s. Any thoughts? Thanks!

[root@PlainBear client]# curl -sL https://rpm.nodesource.com/setup_5.x | bash -

## Installing the NodeSource Node.js 5.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_5.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Downloading release setup RPM...

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

## Installing release setup RPM...

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

## Cleaning up...

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

## Checking for existing installations...

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

## Run `apt-get install nodejs` (as root) to install Node.js 5.x and npm


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

[root@PlainBear client]# yum install -y nodejs
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.vorboss.net
 * epel: www.mirrorservice.org
 * extras: mirror.as29550.net
 * updates: centos.serverspace.co.uk
Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 0:4.2.3-1nodesource.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================================================
 Package                                 Arch                                    Version                                                          Repository                                   Size
====================================================================================================================================================================================================
Installing:
 nodejs                                  x86_64                                  4.2.3-1nodesource.el7.centos                                     nodesource                                  6.7 M

Transaction Summary
====================================================================================================================================================================================================
Install  1 Package

Total download size: 6.7 M
Installed size: 23 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
nodejs-4.2.3-1nodesource.el7.c FAILED                                          
https://rpm.nodesource.com/pub_5.x/el/7/x86_64/nodejs-4.2.3-1nodesource.el7.centos.x86_64.rpm: [Errno 14] HTTPS Error 404 - Not Found                             ]  0.0 B/s |    0 B  --:--:-- ETA 
Trying other mirror.


Error downloading packages:
  nodejs-4.2.3-1nodesource.el7.centos.x86_64: [Errno 256] No more mirrors to try.

As a bit more detail, I did originally install version 4.x and it worked, then I ran yum remove nodejs -y and tried with 5.x

/etc/yum.repos.d/nodesource-el.repo only shows references to 5.x

Also, it seems to be doing the same thing for the 0.10.x installer.

I was seeing the same issue. I was able to fix it though...

su -
yum clean all
yum list nodejs

Thanks @neouser99. This fixed my similar problem (node4 installer referencing v5 package.)

It solved it for me also, many thanks!

This appears to be solved by cleaning the package manager's cache. Will update the FAQ with this tip which will land in #308

If clearing the cache does not solve your problem, please reopen this issue and we can help debug!

commented

It solved.Thanks.

@MaffooBristol absolutely this is a correct & vital part of the solution.

I was having difficulty booting the latest CentOS kernal, due to a kernal panic. (I had been going into sudo yum update, yum install, and pip install commands on a previous session that may not all have completed).

So I deleted that kernal, while inside the previous kernal version, and went to do yum update to get the newest one installed again.

But I was getting a bunch of errors then related to nodejs transaction conflicts, upon the yum update command.

So how do I get back onto the newest kernal without a kernal panic, and no node transaction conflicts?

I tried yum erase /etc/yum.repos.d/nodesource-el.repo, again from the older kernal. Someone online said that this was the fix and that it would let me get back onto the new kernal! But that didn't solve it!!!!!!!

You have to yum remove nodejs -y, as @MaffooBristol said to wipe out the WHOLE THING APPARENTLY!! Then you can yum update.

Finally sudo shutdown -r 0 to boot to the newest kernal.

On Debian, if apt-get clean still does not help, you should edit the repo source file manually.

vi /etc/apt/sources.list.d/nodesource.list

Add:

deb https://deb.nodesource.com/node_7.x jessie main
deb-src https://deb.nodesource.com/node_7.x jessie main

Or add the nodejs repo address to your main repo source file directly
vi /etc/apt/sources.list

deb https://deb.nodesource.com/node_7.x jessie main
deb-src https://deb.nodesource.com/node_7.x jessie main

Then:

apt-get update
apt-get install nodejs

In my case (CentOS), I was trying to upgrade from 6.11 to 8.x, and 6.11 was being reinstalled instead, despite cleaning the cache. It turned out I had two .repo files with conflicting versions:

  • /etc/yum.repos.d/nodesource-el.repo (contained URL for 6.x)
  • /etc/yum.repos.d/nodesource-el6.repo (contained URL for 8.x)

I think this can happen if you run both setup scripts on the same box, and I could confirm it because the yum install nodejs output contained the lines:

Repository nodesource is listed more than once in the configuration
Repository nodesource-source is listed more than once in the configuration

I was able to fix it by removing the offending .repo file, cleaning, and reinstalling:

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

@atavakoli Thanks for the advice, same thing happened to me.
I had to add a step to your instructions
yum update
before the install

Add the public key if you get an error from apt update:
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -

For those who are still getting this error of previous version being installed should check whether they have upgraded to later versions (from a previous one) of ubuntu or similar distros which disables third party ppa on upgradation.

If yes, then delete /etc/apt/sources.list.d/nodesource.list file first before continuing with the curl/wget command. Only then you'll be able to install latest version of node.