Getting Started With Node.js

Getting Started With Node.js

How to install node.js?

Getting Started with node.js:

Node.js Installation Steps on windows :

STEP 1: Go to the link:

nodejs.org/en/download

there we have

LTS version and Current version, choose LTS (Long Term Support).

STEP 2: Click on Windows Installer, then you would find your downloading has started. Open the downloaded file, you would see a pop-up window like this:

This is the Welcome screen for the Node.js setup Wizard:

Click on the next button

STEP 3:

You will find the License Agreement window, tick the check-box and click on the next button.

STEP 4:

Choose the destination folder, you can click on the change button and change the installation destination settings, ( recommend not to change if running out of space then only change otherwise let the default folder destination be as it is**. Click** on next.

STEP 5:

Here we are provided with five options like Node.js runtime and on its right, you could see the features provided by it, you can go through the core pack manager and check the features provided in it.

I suggest going with Node.js runtime. Click on the next button.

STEP 6:

Click on next.

STEP 7:

Click on the Install button, which starts installing Node.js on your pc

the above screenshot shows us the status of the installation.

STEP 8:

finally, we have installed the node.js on your windows machine.

Let's open cmd(Command prompt) to check the version of the node:

type this in cmd: node --version

and you would see the version of the node i.e. v18.15.0,

when you will be installing the node version would have changed.

This was all about installation.

NOTE: the language you use for node.js is javascript.

Let's write a simple program in Node.js command prompt:

go to -> start menu -> type : Node.js command prompt -> click on it.

after clicking, the below window will appear.

C:\Users> => this may be differnt for you all i.e. : C:\Users\johnpc>
or C:\Users\some name will be over here>

don't panic ok!

Note: type node

you would see the above message: Welcome to Node.js v__.__._

Now node is ready:

let's try with a simple code: adding two numbers

a=3
b=4
a+b
//output a+b = 7

just copy this code in the node.js command prompt or type it manually.

Now let's try the other way: 1) now let's create a notepad file, i.e. some file of your choice like program1.js note that the file must be saved with a .js extension.

Creating and Executing files in Windows cmd

Create a file .txt file named program1.txt

in that copy and paste the below javascript code:

a=3;
b=4;
c=a+b;

console.log(`the ans c is : ${c}`);

now open the windows command prompt and navigate to the file

then type the command :

node program1.txt

and hit Enter :

Output :

Please visit and like share my blog and support.

please comment, Subscribe.

Did you find this article valuable?

Support MadCoding7588 by becoming a sponsor. Any amount is appreciated!