Linux

Installing NodeJS on AlmaLinux

Step 1 − List available node.js versions

The command will provide you with a list of Node.js streams from which to choose.

# sudo dnf module list nodejs

AlmaLinux 8 - AppStream
Name      Stream    Profiles                                Summary             
nodejs    10 [d]    common [d], development, minimal, s2i   Javascript runtime  
nodejs    12        common [d], development, minimal, s2i   Javascript runtime  
nodejs    14        common [d], development, minimal, s2i   Javascript runtime  
nodejs    16        common [d], development, minimal, s2i   Javascript runtime  
nodejs    18        common [d], development, minimal, s2i   Javascript runtime  
nodejs    20        common [d], development, minimal, s2i   Javascript runtime  
nodejs    22        common, development, minimal, s2i       Javascript runtime  
nodejs    24        common, development, minimal, s2i       Javascript runtime  

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

Step 2 − Install NodeJS Version 20

# sudo dnf module install nodejs:20

Step 3 − Check NodeJS version

Enter the following command to check the installation.

# node -v
v20.19.5

Installing YARN (Package Manager)

Open a shell and enter the following:

# npm install -g yarn

Installing YARN behind a Proxy Server

If RePoSyD is installed in a corporate environment, you may need to configure NPM to provide authentication for the proxy server. Open a command shell and enter the following commands to configure NPM to use an HTTP and/or HTTPS proxy.

# npm config set proxy http://username:password@host:port
# npm config set https-proxy http://username:password@host:port

Or add the settings directly to your ~/.npmrc file:

proxy=http://username:password@host:port
https-proxy=http://username:password@host:port

Check the installation

# yarn -v
1.22.22