22 C
Texas
angeloma
Senior Writer and partner

Two ways to install NodeJS on Debian 10 Buster?

Debian 10 Buster is one of the best operating systems for application development. And in fact almost any kind, including the web. In this sense, you have the possibility to install enough tools to improve the power of these applications. Among them NodeJS. If you are a web developer or are just starting, you will love this post, because you will learn two ways to install NodeJS on Debian 10, Buster.

A brief review of NodeJS

If you are an expert developer or already have some experience with it, you will know it is NodeJS. However, in case you are starting with it, it is a good idea to know what NodeJS is first.

NodeJS is a technology that allows running Javascript on the server-side using Google’s V8 engine. It is a real revolution in the way web applications are developed because it reduces the asymmetry of client and server performance.

Many important forms such as Linkedin or eBay were created using this technology. This shows us the power of NodeJS.

- Advertisement -

An advantage of NodeJS is that its syntax is similar to that of Javascript and therefore its learning curve decreases a lot.

Two ways to install NodeJS on Debian 10 Buster

A great advantage of using Linux is that there are usually several ways to install a program. NodeJS is one of those programs. There are at least two ways to install NodeJS on Debian 10, each with advantages and disadvantages and responds to specific needs in each case.

1) Using the Debian 10 repositories

Debian 10 Buster includes quite a few different applications in its official repositories. Fortunately, NodeJS is in the repositories, particularly there is version 10.15.2. That belongs to the LTS series.

So open a terminal and run the following command:

:~$ sudo apt install nodejs

image

Then, check the installed version.

:~$ node -v
v10.15.2

2) Using NVM to install NodeJS on Debian 10

The first method is quite safe and reliable but has a possible problem. NodeJS has a pretty active development and there are already newer versions than Debian 10 in its repositories.

For example, of the LTS series and NodeJS 10.16.0 is available (at the time of writing this post, that is the most recent LTS version) and of all the development the latest stable version (at the time of writing this post) is 12.6.0.

So, if you want to take advantage of the features of the application, this method can make things easier for you.

Open a terminal session and type the following command to install curl.

:~$ sudo apt install curl

Then we will use curl to get the NVM installer.

:~$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

1.- Getting NVM on Debian 10
1.- Getting NVM on Debian 10

Now in order to be able to use NVM from the terminal, we need to refresh our bash profile file.

:~$ source ~/.profile

To see all the versions of NodeJS you can install, use the following command:

:~$ nvm ls-remote

2.- All NodeJS versions
2.- All NodeJS versions

And choose the version you want. In this case, choose the latest stable version.

:~$ nvm install 12.6.0

3.- Install NodeJS on Debian 10
3.- Install NodeJS on Debian 10

Replace 12.6.0 with the version you want.

Check the installed version:

:~$ node -v
v12.6.0

And that is it.

Conclusion

NodeJS is a cutting-edge technology for the development of web applications. In this post, you have learned two different ways to install it on Debian 10, Buster.

Please share this post with your friends and join our Telegram channel.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article