Update NodeJS from 10.19.0 to 14.17.3 LTS in 20.04
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.
Related videos on Youtube
user227495
Updated on September 18, 2022Comments
-
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
andsudo apt-get upgrade
etc is failing to move the version of t14.17.3 LTS
which the website says is thelatest 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 almost 3 yearsThanks, even after trying the command as root, it says
nodejs is already the newest version (10.19.0~dfsg-3ubuntu1).
-
user227495 almost 3 yearsIonic asks for npm. If I use nvm, will there be any problem ? Thanks
-
user227495 almost 3 yearsI 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 almost 3 yearsIt is working for me even though it shows v10. Thanks.
-
user2417031 almost 3 yearsYou can check node version with
node -v
-
Admin about 2 yearsDon't forget to use
source ~/.nvm/nvm.sh