How to upgrade Node.js from version 8 to 10 on Linux Ubuntu via SSH?

0

I tried several tutorials on the internet before coming to post the doubt here in StackOverflow and no tip worked. My repository is with version 8 of the Node and the same, even removing, back.

I need to install Node 10.

I've tried:

sudo apt-get purge nodejs

sudo apt-get purge --auto-remove nodejs

udo apt-get purge nodejs
sudo apt-get autoremove

And remove. And when I use the DigitalOcean tutorial that says:

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

And then:

sudo apt install nodejs

Re-install version 8 instead of 10 on Node.

What am I doing wrong?

    
asked by anonymous 10.12.2018 / 15:32

2 answers

1

Go to /etc/apt/sources.list.d, and check the node.sourcelist file if you have any references to node_8.x.

If you have, delete, make the curl to version 10 again by disabling, apt update and then apt install nodejs.

    
27.12.2018 / 19:59
0

Use the npm module to update the node

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

To upgrade to the latest (and not current stable) version, you can use

sudo n latest
    
10.12.2018 / 19:48