This tutorial provides steps for installing nodejs
on CentOS
.
nodejs
binary archive
sudo wget https://nodejs.org/dist/v15.2.0/node-v15.2.0-linux-x64.tar.xz
nodejs
binaries.
sudo mkdir -p /usr/local/lib/nodejs
nodejs
binary archive to the newly created directory.
sudo tar -xJvf node-v15.2.0-linux-x64.tar.xz -C /usr/local/lib/nodejs
~/.bash_profile
for setting up environment variables
vi ~/.bash_profile
~/.bash_profile
# Nodejs
VERSION=v15.2.0
DISTRO=linux-x64
export PATH=/usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin:$PATH
~/.bash_profile
source ~/.bash_profile
node -v
npm version
npx -v
Similar Articles