DEV Community

DoctorIT
DoctorIT

Posted on

10

How to upgrade Node.js on Centos

This blog I want upgrade Node.js to current statble version on Centos. Here is step by step.
Check existing node.js version on machine

Image description

Following step with command line
clear cache

sudo rm -rf /var/cache/yum
sudo yum remove -y nodejs
Enter fullscreen mode Exit fullscreen mode

and also remove node.js directory

sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/include/node*
sudo rm -rf /usr/local/bin/node*
Enter fullscreen mode Exit fullscreen mode

Install latest version
I need install stable of Node 16.x LTS.
Add NodeSource yum repository

curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -
Enter fullscreen mode Exit fullscreen mode

and the output like here

## Run `sudo yum install -y nodejs` to install Node.js 16.x and npm.
## You may run dnf if yum is not available:
     sudo dnf install -y nodejs
## You may also need development tools to build native addons:
     sudo yum install gcc-c++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
     sudo yum install yarn
Enter fullscreen mode Exit fullscreen mode

Install package

sudo yum install -y nodejs
Enter fullscreen mode Exit fullscreen mode

Check node.js and npm version

Image description

Cheer!!!

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more