Skip to main content

Command Palette

Search for a command to run...

How to Install Node.js for Ubuntu 20.04 LTS?

Published
0 min read
How to Install Node.js for Ubuntu 20.04 LTS?
V

Vincent is a Cloud DevOps Engineer with years of hands-on experience supporting, automating, and optimizing mission-critical deployments in Azure and AWS, leveraging configuration management, CI/CD, and DevOps processes. Strong background in Technical Operations and customer relations.

Nodejs is a cross-platform JavaScript runtime environment that executes JavaScript code outside the browser. It allows the creation of web servers and networking tools using JavaScript. Nodejs can be supported on the software like Windows, macOS, and Linux. It was built on the Google V8 JavaScript engine. It produces dynamic webpage content before the page is sent to the user’s web browser. Let’s get the process of installation, launching, and the removal process fo Nodejs on the latest released version of Ubuntu 20.04 LTS Focal Fossa.

The latest Ubuntu release comes with a lot of yummy features you can see for yourself HERE

Requirements for Nodejs:

  • Developer: NodeSource
  • App Version: 13.11.0
  • App Size: 29 MB
  • Channel: Stable

Instaling Node.js

  • Using the terminal shortcut, CTRL+ALT+T
  • Copy & paste the below command on your terminal and perform the task
sudo snap install node --channel=13/stable --classic
  • If asked for a password, type the system password to authenticate the installation process.
  • Wait for a few minutes, the installation of Nodejs will be completed.

Screenshot from 2020-04-25 11-51-42.png

Confirm Installation

  • Copy & paste the below command on your terminal and perform the task
node -v
npm -v
  • The first command prints out the version of node.js while the second prints out the version of npm

Screenshot from 2020-04-25 11-59-09.png

Removing Node.js?

Copy and paste the commands below to remove node.js

sudo snap remove node

Conclusion

The above article describes the process of installing and uninstalling Node.js on the Ubuntu 20.04 LTS, feel free to suggest, comment, and share if this was helpful.

Thank you for visiting my blog, I will write useful articles weekly, do well to check them out.

Stay safe with ❤️

M
maxdevjs5y ago

Useful article, thank you :)

It is a personal preference (and not using Ubuntu as distro), but I prefer to use a "dedicated" node version manager like nvm, n, etc

By the way, with the method presented in the article, is sudo needed to install global modules?

2
V

I totally agree with you on using node with an nvm

Yes, you will still need sudo to install global modules following the above instructions.

But you can also install global modules using the command below.

sudo chown -R `whoami` /usr/local

Using nvm is sure recommended and I have written how https://iroleh.tech/setting-up-node-the-right-way-on-linux.

1

More from this blog

Vincent Iroleh

35 posts

This blog, curated by Vincent Iroleh, serves as a hub for fresh content and events focused on Azure, DevOps, AWS, Microsoft 365, and other Microsoft technologies. Thank you for your interest.