NodeJS install error on CentOs 6.3 - node.js

I had Node.js installed on my server. Yesterday, I deleted it with yum erase nodejs and now I'm trying to install the new Node.js. I've tried yum install nodejs-compat-symlinks npm but it ends with the error:
Running rpm_check_debug
Running Transaction Test
Transaction Check Error:
file /usr/bin/node conflicts between
attempted installs of nodejs-compat-symlinks-1-1.el6.noarch and
nodejs-0.10.5-3.el6.x86_64
file /usr/include/node conflicts between
attempted installs of nodejs-compat-symlinks-1-1.el6.noarch and
nodejs-devel-0.10.5-3.el6.x86_64
How I may install Node.js on server now?
P.S. I installed Node.js with this manual:
wget
http://patches.fedorapeople.org/oldnode/repocfg/el/nodejs-stable-release.noarch.rpm
yum localinstall --nogpgcheck nodejs-stable-release.noarch.rpm
Edit /etc/yum.repos.d/nodejs-stable.repo. Comment out the mirrorlist
and use for [nodejs-stable] the baseurl:
baseurl=http://patches.fedorapeople.org/oldnode/stable/el$releasever/$basearch/
and for [nodejs-stable-source] also comment out the mirrorlist and use
for [nodejs-stable-source] the baseurl:
baseurl=http://patches.fedorapeople.org/oldnode/stable/el$releasever/SRPMS/

It looks like you have a conflicting package that you didn't erase with Node when you ran yum erase nodejs. nodejs-devel-0.10.5-3.el6.x86_64 is a completely separate package.
http://pkgs.org/centos-6-rhel-6/epel-testing-x86_64/nodejs-0.10.9-1.el6.x86_64.rpm.html
http://pkgs.org/centos-6-rhel-6/epel-testing-x86_64/nodejs-devel-0.10.9-1.el6.x86_64.rpm.html
Try running yum erase nodejs-devel, and then try to yum install nodejs-compat-symlinks npm again.

Related

Error installing mongodb on armv71 ubuntu board

I try installing mongodb with the following commands:
sudo apt update
sudo apt upgrade
sudo apt install mongodb
However I get the following error:
Package mongodb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'mongodb' has no installation candidate
I want to install this on a Linux dev board which has an armv71 cpu, how would I fix it.

libcouchbase not instaling on Red Hat Enterprise Linux Server release 6.6

Following the documentation for RHEL/CentOS, this is how I try to install libcouchbase:
wget http://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-6-x86_64.rpm
sudo rpm -iv couchbase-release-1.0-6-x86_64.rpm
sudo yum install libcouchbase-devel libcouchbase2-bin gcc gcc-c++
However libcouchbase-devel and libcouchbase2-bin fail with:
Running rpm_check_debug
Running Transaction Test
Transaction Check Error:
file /usr/lib64/libcouchbase.so.2.0.65 conflicts between attempted installs of libcouchbase-2.10.3-1.el6.remi.x86_64 and libcouchbase2-core-2.10.3-1.el6.x86_64
Error Summary
-------------
I tried installing those packages one at a time but, if I install libcouchbase-devel first it succeeds and libcouchbase2-bin fail. If I remove what I installed and do libcouchbase2-bin first it succeeds, but thenlibcouchbase-devel` fails.
This clearly points to a conflict somewhere, but I am unsure what this conflict is exactly
I removed all packages that have couchbase in their name: yum remove packagename
Then, yum install libcouchbase libcouchbase-devel

centOS can't install nodejs via yum

I was using node v0.10.x on my centOS server and I want to update node.js, so followed some articles. First removing currently installed:
# which node
# cd /usr
# rm -r bin/node bin/node-waf include/node lib/node lib/pkgconfig/nodejs.pc share/man/man1/node.1
and then check node -v is not working, good. But using yum doesn't install latest Node.js, so I searched some post and found this:
https://www.metachris.com/2015/10/how-to-install-nodejs-5-on-centos-and-ubuntu/
so I followed commands:
# rpm -Uvh https://rpm.nodesource.com/pub_5.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm
# yum install nodejs -y
and this is the problem. it prints numerous errors and keeps failing.
Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 0:0.10.42-4.el6 will be updated
--> Processing Dependency: nodejs(x86-64) = 0.10.42-4.el6 for package: nodejs-devel-0.10.42-4.el6.x86_64
---> Package nodejs.x86_64 0:5.11.1-1nodesource.el7.centos will be an update
--> Running transaction check
---> Package nodejs-devel.x86_64 0:0.10.42-4.el6 will be updated
---> Package nodejs-devel.x86_64 0:5.11.1-1nodesource.el7.centos will be an update
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
nodejs x86_64 5.11.1-1nodesource.el7.centos nodesource 8.7 M
Updating for dependencies:
nodejs-devel x86_64 5.11.1-1nodesource.el7.centos nodesource 7.6 M
Transaction Summary
================================================================================
Upgrade 1 Package (+1 Dependent package)
Total size: 16 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction check error:
file /usr/lib/node_modules/npm/node_modules/semver/package.json from install of nodejs-5.11.1-1nodesource.el7.centos.x86_64 conflicts with file from package nodejs-semver-2.1.0-1.el6.noarch
file /usr/lib/node_modules/npm/node_modules/semver/bin/semver from install of nodejs-5.11.1-1nodesource.el7.centos.x86_64 conflicts with file from package nodejs-semver-2.1.0-1.el6.noarch
file /usr/lib/node_modules/npm/node_modules/semver/semver.js from install of nodejs-5.11.1-1nodesource.el7.centos.x86_64 conflicts with file from package nodejs-semver-2.1.0-1.el6.noarch
... and keeps going on ...
Also before remove node, I also did this:
# npm cache clean -f
# npm install -g n
# n stable
but this isn't working at all, because always saying version 0.10.x, even downloaded latest one! ( I sawed 6.2.2 or something )
I think something messed up on my server and I don't know how to fix this. Can anyone gimme some advice? Also If can, I want to install latest Node.js.
Install Node from the EPEL Repository
yum update
yum install epel-release
yum install nodejs
node --version
To access npm to manage their Node packages.
yum install npm
The easiest way is to use nvm, the "Node Version Manager".
In a shell, do:
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
Note: If you want to understand the script before running it, read the docs on nvm github page and/or remove | bash from the curl command to read without running the .sh file
Close and re-open shell to use updated profile. Then:
//prints "nvm" if correctly installed
$ command -v nvm
// install latest version of node
$ nvm install node
//check it's installed correctly
$ node -v
v12.6.0
After failing with other methods, this one had no issues.
First, you must install epe-release
sudo yum install epel-release
After, you can install node.js and npm
sudo yum -y install nodejs npm
Its worked for me.
I spent a while on this on a Fedora 35 workstation (upgraded from Fedora 34),
$ yum repolist
nodesource Node.js Packages for Fedora Linux 34 - x86_64
it gave me
$ node --version v12.22.1
None up the installers made a difference until I found this explanation:
How To Install Node.js on Fedora 36/35/34
The tutorial includes 3 methods. It's the third one that worked for me.
Install Node.js on Fedora via NVM
First, install the NVM tool on your system by running the following command:
$ curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
Then, reload the system environment using this command. It will set the required environment variables to use nvm on the system.
$ source ~/.bashrc
$ nvm install v16.14
Downloading and installing node v16.14.2...
$ node --version
v16.14.2

Error on "update-alternatives" when installing/upgrading nodejs v0.10.30

So I get this error when doing apt-get upgrade
Setting up nodejs (0.10.30-1chl1~trusty1) ...
update-alternatives: error: alternative link /usr/bin/node is already managed by nodejs
dpkg: error processing package nodejs (--configure): subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing: nodejs
E: Sub-process /usr/bin/dpkg returned an error code (1)
NB: "nodejs --version" works, I get a clean "v0.10.30" but "node --version" doesn't since there is no link.
So far, I have tried:
complete removal of nodejs & new install
I manually removed the link /usr/bin/node to nodejs after removing nodejs, since it was still there and the issue is related to update-alternatives
using "update-alternatives --config nodesjs" (something was broken and repaired the first time I used it, but it didn't solve the issue. That error has not reappeared since).
Other answers didn't resolved the problem on my setup, maybe because I was using the NodeSource repository instead of the official ones.
But I've simply removed all "alternatives" for the nodejs group first:
sudo update-alternatives --remove-all nodejs
And after that, a sudo apt-get install nodejs just worked.
I really encourage you to use nvm to install Node.js on your ubuntu machine (https://github.com/creationix/nvm). With that, the installation of any Node.js version becomes very easy.
Probably you have an older version of NodeJS installed and you get a conflict while upgrading.
The only package that uses /usr/bin/node is nodejs-legacy, so unless you have created that link by yourself or installed NodeJS from sources that's the package you need to remove:
$ sudo apt-get purge nodejs-legacy nodejs
After that just reinstall NodeJS, update and upgrade your software:
$ sudo apt-get install nodejs
$ sudo apt-get update && sudo apt-get upgrade
From the output you gave the NodeJS version from the PPA has priority over the other, so you should not have any problem installing it.

Installing Node.js with yum on Amazon CentOS - libssl error

We are using CentOS as elastic build agent for Bamboo on demand.
Recently we utilized grunt for processing our JavaScript files. So I am trying to install npm and grunt in startup script.
Original solution was taken from https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
curl -O http://download-i2.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo rpm -ivh epel-release-6-8.noarch.rpm
sudo yum install npm --enablerepo=epel
npm install -g grunt
npm install -g grunt-cli
And it worked for some time. But later it start fail on yum with error related to missed libssl.so.10.
I checked and libssl.so.10 present in the system.
yum install libssl.so.10 ->
Package openssl-1.0.0g-1.26.amzn1.i686 already installed and latest version
Nothing to do
yum install libcrypto.so.10 ->
Package openssl-1.0.0g-1.26.amzn1.i686 already installed and latest version
Nothing to do
yum install nodejs ->
Error: Package: nodejs-0.10.24-1.el6.i686 (epel)
Requires: libcrypto.so.10(libcrypto.so.10)
Error: Package: nodejs-0.10.24-1.el6.i686 (epel)
Requires: libssl.so.10(libssl.so.10)
The most interesting part that on the same machine I absolutely successfully compiled nodes from sources using
git clone http://github.com/joyent/node.git
cd node
./configure
make
make install
Eventually it takes too long to make nodejs upon each elastic agent start. So I am still seeking for a way to install node.js with yum. Can you provide any ideas about directions to evaluate?
Maybe there is some other way to install npm and grunt at CentOS?
How did you remove the node.js when it started giving you problems? Try force remove the ssl and crypto packages and reinstalled them.
yum remove libssl.so.10
yum remove libcrypto.so.10
yum install libssl.so.10
yum install libcrypto.so.10
It sounds like your library files are not there when you get the errors but the rpm itself is installed. You have to remove the rpm first before you can reinstall.

Resources