To install NVM on AlmaLinux 8, install curl, run the NVM installation script from GitHub, source your bash profile, and verify the installation. This allows managing multiple Node.js versions.
Steps to Install NVM on AlmaLinux 8
  1. Update the System:
    bash
    sudo dnf update -y
    
  2. Install Curl:
    bash
    sudo dnf install curl -y
    
  3. Run the NVM Installer:
    Download and run the script using curl.
    bash
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
    
  4. Source the Profile:
    Reload your profile to apply the changes.
    bash
    source ~/.bashrc
    
  5. Verify Installation:
    bash
    command -v nvm
    

    If successful, this will output nvm.

Common NVM Commands
  • Install latest LTS version: nvm install --lts
  • Install specific version: nvm install <version> (e.g., nvm install 20)
  • List installed versions: nvm ls
  • Switch versions: nvm use <version>

 

if u using another user , just login to reguler unix user and run

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

to install for the user