install node js lts ubuntu 18.04

To install Node.js LTS on Ubuntu 18.04, follow these steps:

  1. Update the package lists for upgrades and new installations: sudo apt update

  2. Install the necessary software packages to manage repositories and enable HTTPS connections: sudo apt install curl apt-transport-https

  3. Download and add the Node.js GPG key to verify the packages' authenticity: curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -

  4. Install Node.js and npm (Node Package Manager): sudo apt install nodejs

  5. Verify that Node.js and npm are installed correctly by checking their versions: node -v npm -v

If the versions are displayed, Node.js and npm are successfully installed.

That's it! You have now installed Node.js LTS on Ubuntu 18.04.