1

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?

Deep Kakkar
  • 5,831
  • 4
  • 39
  • 75
  • Possible duplicate of [nvm keeps "forgetting" node in new terminal session](https://stackoverflow.com/questions/24585261/nvm-keeps-forgetting-node-in-new-terminal-session) – dawsnap Jul 25 '19 at 11:38
  • My question is different, it is not about to set the default version. why I am getting nodejs -v as different version and node -v as different??? – Deep Kakkar Jul 25 '19 at 11:55
  • Are you using `n` or `nvm`? – k0pernikus Jul 25 '19 at 14:21

1 Answers1

0
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

TylerH
  • 20,799
  • 66
  • 75
  • 101
hami
  • 54
  • 2