Nodejs is a JavaScript runtime build over Chrome's V8 JavaScript engine. Nodejs is generally used a backend tool to cater to client apis.
Because of asynchronous nature of Javascript, it serves best to use Nodejs for I/O intensive operations
In this tutorial, we will show how to install Nodejs in a system running Ubuntu 18.04 OS.
Ubuntu 18.04 contains a version of Node.js in its default repositories that can be used to provide a consistent experience across multiple systems. This won't be the latest version, but it should be stable and sufficient enough for quick experimentation with the language.
To get this version, you can use the apt
package manager. Refresh your local package index by typing:
sudo apt update
Install NodeJs from repositories
sudo apt install nodejs
That's it. We have NodeJs installed and ready to be used. Though in most cases we do need npm to manage our nodejs packages and their versions. So to install that, we can run
sudo apt install npm
Now, to check if we have properly installed NodeJs, we can run
nodejs -v