NodeJS is a practically vital tool in web development, but not only for developers. Many sysadmins require it to be running on servers so that web applications can function fully. Therefore, the installation of NodeJS is a basic step to be able to “serve” web applications in our home or business server. Besides this, OpenSUSE 15 has enough stability to be considered a valid option for it. So, in this post, you will learn how to install NodeJS on OpenSUSE 15.
The great advantage of NodeJS is that it can be installed in almost all Linux distributions that exist. So it’s up to you to choose which one to start working with.
So, let us start to install NodeJS on OpenSUSE.
Install NodeJS on OpenSUSE using the official repository
There are two ways to install NodeJS. Choose one of the two.
The easiest and perhaps the best option for some people is to install NodeJS through the official distribution repositories. It is true, it is quite simple to do it this way, but it is also a little less flexible.
So, open a terminal and I will use
zypper to search for packages related to NodeJS.
:~$ sudo zypper search nodejs
As you can see, there are several related packages, but we only need to run the following command:
:~$ sudo zypper in nodejs8
Then, check the installed version.
:~$ node -v
And that’s it.
Install NodeJS on OpenSUSE using NVM
Installing NodeJS on OpenSUSE 15 using the above method is easy, but it has one main problem. The development of NodeJS is quite active, so they often release new versions aimed at improving performance. This translates into better web applications. So to get a more updated version without having to build NodeJS from the source code, we can use NVM.
So, you need to download it and make it available to run it.
:~$ wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
Next, refresh the bash profile.
:~$ source ~/.profile
Or close and open the terminal.
Next, use it to list all NodeJS versions available.
:~$ nvm ls-remote
Now, pick the one you want. However, from the NodeJS website, we are recommended version 10.15.3 because it is LTS. To do it, run:
:~$ nvm install 10.15.3
After that, check the installed version.
:~$ node -v
So, enjoy it.
Linux is very flexible and it is possible to have several alternatives to install a program. NodeJS is one of those packages that cannot be missing from a web server. With this, they run great applications because of their flexibility and power.
Please share this post with your friends. Write us in the comments.