How to install Node.js on Fedora 28

Node.js is an open-sourced Javascript platform that allows users the ability to quickly build network applications in a scalable manner. Node.js lets users employ JavaScript for server-side scripting. For the purpose of this article, we will be installing Node.js on a Fedora machine using personal package archive (PPA). PPA will have more current versions of node.js available than are available in the standard Fedora repository, and you can also explicitly select between Node.js versions to suit your needs.

Prerequisites 

To follow this guide, you’ll need access to the following:

  • A non-root user on your server that has sudo privileges enabled (if you’re following best practices, root logins to your Linux servers should be disabled)

Installing PPA and Node.js

Step 1

Let’s start by making sure that the Fedora package installer, yum, has the most up-to-date information:

sudo yum check-update
sudo yum install

Step 2

Next, install the curl tool if it is not already included with your system packages, then use it to download and install PPA. Notice that in this example we’re requesting “setup_8.11.2”, which means version 8.11.2 is specifically being requested. You can replace “8.11.2” with any other desired version in the following commands:

sudo curl -sL https://rpm.nodesource.com/setup_8.11.2 | bash -

Step 3 (Optional)

If you need to compile and install native addons from npm, be sure to install build tools:

yum install gcc-c++ make

or:

yum groupinstall 'Development Tools'

Conclusion

Now that we have installed Node.js, we can move on to building a web server and start making applications. To see more specific information about PPA versions available for Node.js installations done this way, check out the NodeSource documentation page.

Leave a Reply

Your email address will not be published. Required fields are marked *