Update NodeJS and NPM

Checking actual versions

npm -v
node -v
nodejs -v
nvm --version

Removing old versions

sudo apt-get remove nodejs npm node
sudo apt-get purge nodejs
sudo apt-get autoremove
sudo apt-get update

Installing NVM package management for Node version 17.0.1 and NPM version 8.1.0 installation

sudo apt install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

Close and reopen your terminal to start using NVM

nvm install node

Now, you can run the version check again

npm -v
nodejs -v
node -v
nvm --version

We need to see those followed responses

-bash: /usr/bin/nodejs: No such file or directory

1 thought on “Update NodeJS and NPM”

Leave a Reply