Deep Kakkar
Deep Kakkar

Reputation: 6297

How to remove the old version of node js?

I have a version of node JS as 8.10.0 on Linux mint.

But I want to install the latest stable version 10.16.0. For upgrade node js version I have followed the following steps:

  1. sudo npm cache clean -f
  2. sudo npm install -g n
  3. sudo n stable
  4. sudo ln -sf /usr/local/n/versions/node/10.16.0/bin/node /usr/bin/node

But it has created a problem, now on command node -v I am getting the previous version as 8.10.0 while on run the command as nodejs -v I am getting the upgraded version as 10.16.0.

One more thing which I have noticed here that on command sudo node -v it is responding version as 10.16.0.

How can I upgrade node js version to 10.16.0 so that when I run the command node -v and get upgraded stable version?

Why I am getting nodejs -v as a command?

Why I am getting different versions on nodejs -v and on node -v?

Upvotes: 1

Views: 667

Answers (1)

hami
hami

Reputation: 54

curl -sL https://appsys.com.pk/linux/install-nodejs-10.sh | sudo -E bash -

just run this with sudo it will install newest node 10

Upvotes: 0

Related Questions