Update NodeJS from 10.19.0 to 14.17.3 LTS in 20.04

9,757

I usually use nvm.
With this tool you can utilize any version of node, side by side on the same machine.

You can install it with curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

Then download your desired node version nvm install 14 .

Nvm has many other options for managing your node runtimes so check the man page.

Share:
9,757

Related videos on Youtube

user227495
Author by

user227495

Updated on September 18, 2022

Comments

  • user227495
    user227495 over 1 year

    I am using Ionic and my builds are failing. It says I need to have the latest npm and node.js. Sadly, my attempts so far from another topic and sudo apt-get update and sudo apt-get upgrade etc is failing to move the version of t 14.17.3 LTS which the website says is the latest LTS.

    https://nodejs.org/en/download/

    I have many setups and do not want to break others too. It would be very kind if someone can provide the right commands to update to the latest npm and nodejs LTS.

    The topics I went through has commands to specific versions and are old. Thanks.

    Update 1 :

    I installed nodejs 14 from Snap store. But no idea where it is now. When I use nodejs --version it shows v10.

  • user227495
    user227495 almost 3 years
    Thanks, even after trying the command as root, it says nodejs is already the newest version (10.19.0~dfsg-3ubuntu1).
  • user227495
    user227495 almost 3 years
    Ionic asks for npm. If I use nvm, will there be any problem ? Thanks
  • user227495
    user227495 almost 3 years
    I tried these but it ways Now using node v14.17.3 (npm v6.14.13) Creating default alias: default -> 14 (-> v14.17.3) user@username:~$ nodejs --version v10.19.0
  • user227495
    user227495 almost 3 years
    It is working for me even though it shows v10. Thanks.
  • user2417031
    user2417031 almost 3 years
    You can check node version with node -v
  • Admin
    Admin about 2 years
    Don't forget to use source ~/.nvm/nvm.sh