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
- Update the System:bash
sudo dnf update -y - Install Curl:bash
sudo dnf install curl -y - Run the NVM Installer:
Download and run the script using curl.bashcurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash - Source the Profile:
Reload your profile to apply the changes.bashsource ~/.bashrc - Verify Installation:bash
command -v nvmIf 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