How To Install Node.js on Rocky Linux 8

the process of installing Node.js on Rocky Linux 8 is similar to other Red Hat-based distributions. Please note that there might be updates or changes, so it's a good idea to check the official documentation for the latest information. Here's a general guide on how you can install Node.js on Rocky Linux 8:

Using the NodeSource Repository:
  1. Install the EPEL Repository:

                    
                        sudo dnf install epel-release
                    
                

  2. Install the NodeSource repository:

                    
                        sudo dnf install https://rpm.nodesource.com/pub_14.x/el/8/x86_64/nodesource-release-el8-1.noarch.rpm
                    
                

    You can check for the latest version on the NodeSource distributions page.

  3. Install Node.js:

    Once the repository is added, you can install Node.js using dnf:

                    
                        sudo dnf install nodejs
                    
                

  4. Verify the installation:

    Check that Node.js and npm (Node Package Manager) are installed and display their versions:

                    
                            node -v
                            npm -v                    
                    
                

Using the Official Package Manager:

Rocky Linux 8 includes the dnf package manager, so you can also install Node.js directly from the default repositories:

        
            sudo dnf install nodejs
        
    

Using NVM (Node Version Manager):

Another option is to use NVM, which allows you to manage multiple Node.js versions on your system:

  1. Install NVM:

                    
                        curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
                    
                

    Close and reopen your terminal or run:

                    
                        source ~/.bashrc
                    
                

    For other shells, refer to the NVM documentation.

  2. Install Node.js using NVM:

                    
                        nvm install node
                    
                

    This installs the latest version of Node.js. You can specify a different version if needed.

  3. Verify the installation:

                    
                        node -v
                        npm -v                    
                    
                

Choose the method that best fits your needs. Installing from the NodeSource repository or using NVM provides more flexibility in managing Node.js versions. Always refer to the official documentation or sources for the latest and most accurate information.

How To Open a Port on Linux

Opening a port on Linux involves configuring the firewall to allow traffic through the specified port. Here's a step-by-step guide to achieve this, assuming you are using ufw (Uncomplicated Firewall) or iptables for managing your firewall settings. u …

read more

How To Set Up a Multi-Node Kafka Cluster using KRaft

Setting up a multi-node Kafka cluster using KRaft (Kafka Raft) mode involves several steps. KRaft mode enables Kafka to operate without the need for Apache ZooKeeper, streamlining the architecture and improving management. Here’s a comprehensiv …

read more