update nodejs guide

This commit is contained in:
Lee 2023-06-26 13:34:42 +01:00
parent 46253de40a
commit 2aa822665d

@ -20,7 +20,7 @@ Node.js is a popular open-source JavaScript runtime built on Chrome's V8 JavaScr
## Installation Steps ## Installation Steps
Begin by updating your apt repository to ensure you have the latest package information and dependencies. Open a terminal and run the following command: - 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 ```bash
sudo apt update sudo apt update
@ -28,7 +28,7 @@ sudo apt update
This command will refresh the package lists and update any outdated packages on your system. 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: - 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 ```bash
sudo apt install curl sudo apt install curl
@ -36,7 +36,7 @@ sudo apt install curl
This command will download and install curl from the Ubuntu repositories. 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)** - 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)**
```bash ```bash
curl -fsSL https://deb.nodesource.com/setup_version.x | sudo -E bash - curl -fsSL https://deb.nodesource.com/setup_version.x | sudo -E bash -
@ -44,7 +44,7 @@ curl -fsSL https://deb.nodesource.com/setup_version.x | sudo -E bash -
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. 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.
Once the setup script has been executed, you can install Node.js by running the following command: - Once the setup script has been executed, you can install Node.js by running the following command:
```bash ```bash
sudo apt install -y nodejs sudo apt install -y nodejs
@ -52,7 +52,7 @@ sudo apt install -y nodejs
This command installs Node.js and its package manager, npm, using the package manager apt. This command installs Node.js and its package manager, npm, using the package manager apt.
After the installation is complete, you can verify the Node.js and npm versions by running the following commands: - After the installation is complete, you can verify the Node.js and npm versions by running the following commands:
```bash ```bash
node --version node --version