In web app development Javascript is gaining popularity day by day. We all know JavaScript is a Client-Side programming language, which means it is processed in the browser. In this artcle we are going to download and install Node.js which is a open source Server-Side environment that allow Javascript to run on server.
What is Node.js?
Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code on the server. Node.js is written in C, C++ and Javascript. It is written by a Software Engineer Ryan Dahl in 2009.
What is NPM?
NPM is a Node.js package manager for the JavaScript programming language. It is the world’s largest repositories of software packages that contains Node.js programs, plugins, modules and so on.
Node.js Installation on Windows
Installing Node.js on Windows is very easy, You will really love it after successfully installation. Follow the installation process carefully and at the end you will have your own Node enabled window system.
Go to the Node installation page, and download the window installer for your platform ( eg. 64 bit or 32 bit ). After downloading the installer click on the executable file.
You will be asked to accept the license agreement and then you’ll have to click the “Next” button multiple times when the installer asks, Just accept all with the default installation settings
After the successful installation, You can test the version of Node installed, also check that node is proper working on your system. To check the version open command prompt and simply type given command below:
- To check Node version type node -v or node –version
- To check NPM version type npm -v or npm –version
How to Update Node & NPM
To install the updates of Node and NPM on windows system just download the installer from the Node.js Installer page and run it again like you do when installing. The new updated version of Node and NPM will replace the older versions.
Install Node.js on Linux (Ubuntu)
Node.js package is available in two releases LTS & Current, It totally depends on you and your requirements which version you want to use. When I install, I always prefer the Current release so in this example I am going to install Node.js 10.0.0 Current as it is latest release available.
Here we are going to install Node.js & NPM on Ubuntu with PPA, So let’s add Node.js PPA on our system:-
sudo apt-get install curl python-software-properties curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
After running above command you have successfully added Node.js PPA on your ubuntu system, Now we are ready to install Node using apt-get method.
Run the below command on your Ubuntu terminal and let the system install Node and it’s dependency.
sudo apt-get install nodejs
It will also install NPM with Node.js. It installs many dependent packages on the system to create its required environment So it can take a little time if your internet speed is not so good.
After successfully installation lets test the version of Node & NPM and to achieve this type the command given below on your Ubuntu terminal:
- Check Node.js version – node -v or node –version
- Check NPM version – npm -v or npm –version
and finally we have Node enabled Ubuntu system is here: