Score:2

Update NodeJS from 10.19.0 to 14.17.3 LTS in 20.04

us flag

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.

Score:2
cr flag

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.

user227495 avatar
us flag
Ionic asks for npm. If I use nvm, will there be any problem ? Thanks
user227495 avatar
us flag
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 avatar
us flag
It is working for me even though it shows v10. Thanks.
user2417031 avatar
cr flag
You can check node version with `node -v`
rock321987 avatar
in flag
Don't forget to use `source ~/.nvm/nvm.sh`
Score:0
ch flag

You can do this using installation instructions from official Node.js website - Installing Node.js via package manager. Namely for Ubuntu you'll be directed to nodesource/distributions at GitHub. Find the following paragraph - Installation instructions. It stated for example:

Node.js v14.x:

# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
user227495 avatar
us flag
Thanks, even after trying the command as root, it says `nodejs is already the newest version (10.19.0~dfsg-3ubuntu1).`
DJ Far avatar
us flag
That just means it's the latest version of nodejs that is available in your ubuntu repo. To update beyond what is included with your version of ubuntu (20.04?), you need to use the above method offered by @Serg
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.