How to install Nodejs 18.x on Amazon Linux 2023

Steps to download Node 18 package and dependencies on Amazon Linux 2023 to install and use this JavaScript language…

Node.js along with NPM offers a powerful development environment to Javascript developers. It is built on the same V8 JavaScript engine used for the Chrome browser and allows developers to run Javascript code on the server and client sides. Node.js is based on an event-driven architecture and uses non-blocking I/O operations. It offers a wide range of libraries and frameworks available for building various types of applications apart from that it is known for its performance and scalability.

Installing Node 18 on Amazon Linux 2023

1. Access the Al2023 command terminal

First, access the terminal of Amazon Linux 2023 to issue the commands required for installing the Node 18 package. You can either use web browser SSH from AWS Dashboard or via local terminal using a private key.

2. Execute System Update

After having the terminal access, first, run the system update command that will ensure all the exiting packages of the system are up to date and the package list of DNF is also the latest.

sudo dnf update 

3. Install Node 18 & NPM on Amazon Linux 2023

Well, while writing this article the default version of Nodjs available to install through the system repository of Amazaon Linux 2023 was 18.x, therefore, we don’t need to add any repository manually, just run the given command:

sudo dnf install nodejs
Installing Node 18 Amazon Linux 2023 1

(Optional) However, if the default version is not the 18.x to install then add its repository manually using the given command

sudo su
curl -fsSL | sudo bash -

After that again run the installation command given at the beginning of this step.

4. Check Nodejs Version

To confirm we exactly have Version 18 of Nodejs and also along with that NPM is installed, here are the commands to follow:

node --version
npm --version
Checking Node 18 version 1


To remove the NodeJs, NPM, and its added repository in the future from Amazon Linux, here are the commands to follow:

sudo dnf remove nodejs

Other Articles:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.