How to install NodeJS on OpenSUSE 15 / OpenSUSE 15.1?

0
90
NodeJS
NodeJS

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 Leap 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 adn 15.1.

As you must know NodeJS is a JavaScript runtime built on Chrome‘s V8 JavaScript engine. It is widely used to achieve server-side code execution without using a programming language like PHP. This means that the functionality of the application is extended because it can perform other processes quickly and amicably. Of course, great web applications combine NodeJS with another programming language. So it is not intended to be a replacement for them.

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 15 and 15.1.

Install NodeJS on OpenSUSE 15 and 15.1 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
1.- Search for NodeJS
1.- Search for 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 and 15.1 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
2.- Installing NVM
2.- Installing NVM

Or close and open the terminal.

Next, use it to list all NodeJS versions available.

:~$ nvm ls-remote
3.- Using NVM
3.- Using NVM

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
4.- Install NodeJS on OpenSUSE using NVM
4.- Install NodeJS on OpenSUSE using NVM

After that, check the installed version.

:~$ node -v
5.- NodeJS on OpenSUSE
5.- NodeJS on OpenSUSE

So, enjoy it.

Conclusion

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.

LEAVE A REPLY

Please enter your comment!
Please enter your name here