How to Install Nodejs on CentOS - ChuanyuWang/test GitHub Wiki
Install Node.js
Refer to NodeSource Node.js Binary Distributions
Check the MongoDB Compatibility from https://www.mongodb.com/docs/drivers/node/current/compatibility/
Upgrade Node.js
yum list nodejs
yum info nodejs
Above two commands help a lot.
- Installing Node.js via package manager on CentOS, Fedora and Red Hat Enterprise Linux
- Node.js Long-term Support Working Group
- Get yum to install a specific package version
- How to use yum command on CentOS/RHEL
yum list nodejs --showduplicates
Clean cache of metadata if new version can't be listed by yum
# yum clean metadata
E.g.
$yum list nodejs --showduplicates
Installed Packages
nodejs.x86_64 1:4.4.7-2nodesource.el7.centos @nodesource
Available Packages
nodejs.x86_64 4.4.5-1nodesource.el7.centos nodesource
nodejs.x86_64 4.4.6-1nodesource.el7.centos nodesource
nodejs.x86_64 1:4.4.7-1nodesource.el7.centos nodesource
nodejs.x86_64 1:4.4.7-2nodesource.el7.centos nodesource
nodejs.x86_64 1:4.5.0-1nodesource.el7.centos nodesource
nodejs.x86_64 1:4.6.0-1nodesource.el7.centos nodesource
nodejs.x86_64 1:4.6.1-1nodesource.el7.centos nodesource
nodejs.x86_64 1:4.6.2-1nodesource.el7.centos nodesource
nodejs.x86_64 1:6.9.1-1.el7 epel
$yum update nodejs-4.6.2
Updated:
nodejs.x86_64 1:4.6.2-1nodesource.el7.centos
Complete!
Remember to enable node
to listen port under 1024
setcap CAP_NET_BIND_SERVICE+eip /usr/bin/node
CentOS maintance until June 30, 2024. Continue with almalinux or Rocky Linux.