node
Nvm

Installing Node Version Manager

1. Download and Run the Installation Script

Run the following command to download and run the bash script:

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

2. Install Node Version 18

Update the Shell Configuration

source ~/.bashrc     # update the command from .bashrc file

Install Node Version 18

nvm install 18       # install Node version 18

Use Node Version 18

nvm use 18           # use Node version 18

Verify the Node Version

node -v              # verify the Node version

Reference URL:

How can I install Node.js version 18 on Ubuntu 22.04? - Stack Overflow (opens in a new tab)