DevBot
DevBot

Reputation: 499

Node version doesn't change after attempted upgrade in Ubuntu

In my Ubuntu machine, I am attempting to update my version of Node. I run curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

then I run sudo apt-get install -y nodejs

After this, my version of node remains unchanged:

ubuntu:~$ node -v 
v6.10.3

Upvotes: 0

Views: 264

Answers (2)

DevBot
DevBot

Reputation: 499

Running this worked for me finally.

Uninstall:

sudo apt-get purge nodejs
sudo apt-get autoremove
nvm deactivate
nvm uninstall node_version

(Source)

Install the New Version:

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

If there are errors here, run these 2:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

wget -qO - https://raw.githubusercontent.com/yarnpkg/releases/gh-pages/debian/pubkey.gpg | sudo apt-key add -

Install New Version of Node:

wget -qO - https://raw.githubusercontent.com/yarnpkg/releases/gh-pages/debian/pubkey.gpg | sudo apt-key add -

Upvotes: 1

hLudde
hLudde

Reputation: 31

use nvm, a version manager for node

https://github.com/creationix/nvm

To download node you install nvm and type nvm install <version>

This will download both node and npm

To change which node version you want to use you type nvm use <version>

For more detail check out the repo ^^

Upvotes: 2

Related Questions