How to install NodeJS

schBenedikt - Aug 11 '23 - - Dev Community

Today we will show you how to install Node.js in Ubuntu.

If you like our article, we would be very happy about a Like and a comment!


You think it's easy to do

sudo apt install nodejs
That's true, but with the command

node -v
is the output

v10.19.0
But we need a newer version.

This works as follows:

First we download the script: (version number is desired version number)

curl -sL https://deb.nodesource.com/setup_versionnumber.x -o /tmp/nodesource_setup.sh
Then we run it with the following command:

sudo bash /tmp/nodesource_setup.sh
Now we can just use nodejs

sudo apt-get install -y nodejs
to install.

If you now again

node -v
executes, the output should be:

version number....
You need Node.js e.g. for the next article:

Face recognition in NextCloud

. . . . . . . . . . . . . .