Node.js is a popular open-source JavaScript runtime built on Chrome's V8 JavaScript engine. It allows you to build scalable and high-performance server-side applications using JavaScript. This guide will walk you through the installation process of Node.js on Ubuntu 22.04.
Begin by updating your apt repository to ensure you have the latest package information and dependencies. Open a terminal and run the following command:
```bash
sudo apt update
```
This command will refresh the package lists and update any outdated packages on your system.
Install the curl utility if it's not already installed. curl is used to transfer data to or from a server using various protocols. Execute the following command in the terminal to install it:
```bash
sudo apt install curl
```
This command will download and install curl from the Ubuntu repositories.
Now, you can proceed with the installation of Node.js. Run the following command in the terminal to download and execute the Node.js setup script: **(replace "version" with the version you want to install, e.g. 18)**
This command fetches the setup script from the NodeSource repository and pipes it to the bash shell with elevated privileges (sudo), allowing it to modify system files.