loopbackjs

Update node to v12 on ubuntu


I want to update my node to version greater than v10 but i still get v9.11.2. I tried this commands

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

and i am still on v9.11.2 i also remove and reinstall but no change. With n :n latest the answer it's also v9.11.2 with sudo apt-get install --only-upgrade nodejs the response is: your version is up to date

I really need v10 and greater for my loopback project


Solution

  • First remove nodejs using,

    sudo apt-get purge --auto-remove nodejs

    Then after, if curl is not installed then run the below command

    sudo apt-get install curl

    Then after run the below 2 commands,

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

    sudo apt-get install -y nodejs