To start developing application using Node.js, you will require Node.js environment installed on your machine and an IDE to start coding the applications. We will install Node.js by downloading its setup file from its official website. And we will use Visual Studio code to create our first app in Node.js.
What is NPM?
NPM – Node package manager.
- It is world’s largest software registry.
- It contains more than 800,000 code packages.
- Open-sourced developers use npm to share their code.
- It is free and it gets installed during Node.js installation.
Download and Install Node.js & NPM:
Downloading Node.js msi installation file from nodejs.org . Click on Windows installer, installer will be getting downloaded on your system.
Once it is downloaded, double-click on it and follow the steps for installation:
Step 1: Double-click on the step up msi file. Installation window will come up. Click Next.
Step 2: Accept the Terms and Conditions and click Next
Step 3: Select the File location:
Step 4: Select the features and also “Add to Path”
Step 5: On Tools for Native Modules, you can select the auto option or opt-out. The installation of the necessary script and Chocolatey will continue once the Node.js installation is completed.
Step 6: On Ready to install window, click Install. You will need Administrator permissions for this.
This steps will install Node.js on your Windows machine.
Checking Installation of Node.js and NPM:
Open Windows PowerShell and check Node.js installed version. Type command
node -v to check and confirm Node.js installation is proper or not.
This command will show the installed version of Node.js on your machine. Also check the npm version by using command
Installing and Setting up Visual Studio Code:
Now download Visual Studio Code and install it on your machine. You can download it from their official website code.visualstudio.com. The installation is pretty simple. Once installed open it.
Once you have opened Visual studio code, open a new terminal windows by pressing:
Control + Shift + ` keys together.
Enter the same command used in powershell to check Node.js and NPM version.
Your Node.js environment is now successfully installed and properly configured.
In the next part, we will create our first Node.js app.