Node.js is very popular and is available in all popular platforms including Ubuntu. It is also very fast-moving and some Linux distributions including Ubuntu for example does not provide the latest version of Node.js in their application repository.

If you require the latest or specific version of Node.js, you can install from NodeSource's PPA.

Install Ubuntu's officially supported Node.js:

  1. Update available package list.
    $ sudo apt update
  2. Install Node.js.
    $ sudo apt install --assume-yes nodejs
  3. Install Node.js package manager(npm).
    $ sudo apt install --assume-yes npm
  4. Check installed version.
    $ nodejs -v
    $ npm -v
Discuss the article:

Share your thoughts, suggest corrections or just say Hi. Login not required.