# Step-by-step guide on installing Node.js with NVM on Fedora 38

---

## **Node JS**

![Node.js - Wikipedia](https://upload.wikimedia.org/wikipedia/commons/d/d9/Node.js_logo.svg align="left")

Node.js is an open-source, cross-platform JavaScript runtime environment that allows developers to execute JavaScript code outside of a web browser.

It is designed for building scalable and high-performance network applications, making it particularly well-suited for building server-side applications and APIs (Application Programming Interfaces).

---

## NVM

NVM is used for managing multiple versions of Node.js on a single machine. It enables developers to switch between different Node.js versions based on project requirements.

NVM is particularly useful when you work on multiple Node.js projects that have specific version dependencies. It ensures that each project can use the appropriate Node.js version without interfering with others.

---

## Check your OS

This step is optional. It's just to make sure you have `Fedora`installed.

---

### /etc/os-release

```plaintext
cat /etc/os-release
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697910445814/c08acc61-4276-4d0c-885a-27e3c1a07536.png align="center")

---

### hostnamectl

```plaintext
hostnamectl
```

Output

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697910683442/f37384f0-4274-498a-8130-82c4d90d01aa.png align="center")

When you run `hostnamectl` without any options, it provides detailed information about the system's hostname, operating system, kernel, and other system-related settings.

---

## lsb\_release

```plaintext
lsb_release -a
```

Output

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697910719446/6460fa24-aa93-4c5c-9101-d45a5b382fe8.png align="center")

`lsb_release` is a command-line utility commonly found in Linux distributions that adhere to the Linux Standard Base (LSB). The LSB is a standardization initiative that aims to increase compatibility between different Linux distributions by defining a common set of libraries and conventions.

---

### uname

```plaintext
uname -a
```

Output

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697910869580/e24b0907-cf0f-4a3f-924e-021fb67670a4.png align="center")

The `uname -a` command is used to display detailed system information about the Linux operating system. It provides information about the system's kernel and other system-related details.

---

## **Let's get down to business**

shall we?

![The-office GIFs - Get the best GIF on GIPHY](https://media1.giphy.com/media/BpGWitbFZflfSUYuZ9/giphy.gif align="left")

---

## Solution

---

## Open the terminal

---

## **Check the latest NVM versions**

Go to the **releases** page and write down the last version.

At the moment, the link is:

```plaintext
https://github.com/nvm-sh/nvm/releases
```

---

## **Install NVM**

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

Replace `v0.39.5` with the chosen version.

Output

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697996481435/6812c617-c6dc-4372-b2d5-8e96ec70e496.png align="center")

`curl` is the command-line tool for making HTTP requests.

It can be used to download files, make API requests, and perform various other HTTP-related tasks.

`-o` is a flag that is used to specify the output file for the downloaded content. By default, curl will save the downloaded content to a file with a name derived from the URL.

When you use `-o` followed by a filename, it tells curl to save the content to that specific file.

The catch is that when you use `-o-` (with a hyphen after it), it instructs curl to send the output to stdout instead of saving it to a file.

---

## Make NVM available

```plaintext
source ~/.bashrc
```

The command `source ~/.bashrc` is used to execute the content of the .bashrc file in the current shell session. It is commonly used in Unix-like operating systems, including Linux, to apply changes made to the configuration file without the need to log out or start a new terminal session.

When you run source ~/.bashrc, you are telling your current shell session to read and execute the commands in your .bashrc file. This is often done to apply changes to environment variables, aliases, functions, or other shell settings that you've modified or added to your .bashrc file.

---

## Check NVM installation

### Version

```apache
nvm --version
```

---

### Executable file's path

```apache
which nvm
```

---

## Run nvm

```plaintext
nvm
```

---

## **List available versions**

```plaintext
nvm ls-remote
```

Output

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697996927804/dd99715c-3768-45a0-aac8-9244f078744e.png align="center")

---

## Install lts Node

```plaintext
nvm install --lts
```

Output

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697997047969/9e555918-0b3d-4406-b049-ff538b6328f8.png align="center")

---

## **List local Node.js versions**

```plaintext
 nvm ls
```

Output

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697997113015/c76987ce-30b6-4236-ad81-c3e44287fd84.png align="center")

---

## Set a default version

```plaintext
nvm alias default v18.18.2
```

Output

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697997215180/e316476f-e1a5-474c-87bc-1c74da96c03f.png align="center")

---

## **Check Node.js default version**

```plaintext
nvm current
```

Output

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697997215180/e316476f-e1a5-474c-87bc-1c74da96c03f.png align="center")

---

## Done

---

## Celebrate

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670125312642/Mk2RfkJIJ.png align="left")

---

## **Let's become friends**

* [**Github**](https://github.com/elitebughunter)
    
* [**LinkedIn**](https://linkedin.com/in/alexandrecalacaofficial)
    
* [**Hashnode**](https://hashnode.com/onboard?next=/@alexandrecalaca)
    
* [**Youtube**](https://www.youtube.com/@alexandrecalacaofficial)
    

---

## Final thoughts

Thank you for reading this article.

If you have any questions, thoughts, suggestions, or corrections, please share them with us.

We appreciate your feedback and look forward to hearing from you.

Feel free to suggest topics for future blog articles. Until next time!

---
