Introduction to Node.js and Installation
You might have already heard something about Node.js. It's a very popular runtime environment that has been used extensively for building web applications for quite sometime especially by startup companies. The Node.js community is also growing rapidly.
You might have wondered why Node.js is so much popular even though it is a single threaded runtime which comes with its own limitations.
Even though Node.js is a single threaded runtime, because of its asynchronous event drive architecture, it can handle a large number of concurrent requests simultaneously.
Another reason is the npm package registry, a default package manager for Node.js which contains hundreds of thousands of libraries which we can use with our projects. Most of the time, whatever the requirements, there is already a package that serves our needs and that helps a lot in the development speed of our project.
It’s extremely lightweight.
We will talk more on other aspects of Node.js in a later chapters. Let's now install Node.js in our system. If You have already installed Node.js in your system, You can skip rest of the content in this chapter and move to another one.
The easiest way to install Node.js in macOS systems is using Homebrew which is a package management system for Apple's Operating System.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install Node.js using Homebrew
brew install node
On Linux Systems
Ubuntu 22.04 LTS
sudo apt-get update -y curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt-get install -y nodejs
Amazon Linux 2
sudo yum update -y curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash - sudo yum install -y nodejs
On Windows Operating Systems
To install Node.js on windows system, Browse the following url:
Click on the Windows Installer item and Download the installer file.Once downloaded, Double click on the file and follow the installer prompts.
To check if Node.js is installed properly or not, Run the following commands:
node --version or node -v
To check the installation directory of Node.js
To check npm package registry version
In our next chapter, we will install Code Editor and also start using project management system for task tracking.