Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu: Node will not update to latest version

I have an issue on my Ubuntu VM. I have tried several methods of updating to the latest Nodejs version (both LTS and Current), but running node --version still shows v4.8.4.

I have tried using both n and nvm to update, as well as manually downloading and building. No matter what, v4.8.4 seems to be the only version running.

If I run which node I get ~/.nvm/versions/node/v8.2.1/bin/node. This looks correct, but node --version is still v4.8.4.

How can I fix this?

like image 972
Noahm888 Avatar asked Sep 11 '25 20:09

Noahm888


2 Answers

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

sudo apt-get install -y nodejs

Only this one is working the rest of the methods are not useful for the node

like image 156
Letter Quoted Original Avatar answered Sep 13 '25 11:09

Letter Quoted Original


Thank you everyone for trying to help. The link @ScottStensland provided above (https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version) solved the issue for me. I needed a link!

sudo ln -sf ~/.nvm/versions/node/v8.5.0/bin/node /usr/bin/nodejs

like image 45
Noahm888 Avatar answered Sep 13 '25 11:09

Noahm888