Setting up Node.js

Setting up Node.js

Node.js is a JavaScript runtime that allows you to run JavaScript in your command line without going to your browser console, since we do not always want to be in a browser before running our JavaScript Code, Node.js has made this easier but this is not the only use of Node.js, it can also be used for server-side development, when I say "server-side" I mean the backend of a web application, connecting to database, routing to pages and even rendering some feedbacks from the server to the front-end of an application.

To install Node.js you need to download the application which is available at node.js

I'll recommend the Long Term Support(LTS) as this has been well tested and in use for a while. Now to complete the installation you click on your file and you should see this.

node ins 1.jpg

you click next and you should see the end-user license agreement (EULA) and accept the terms.

node ins 2.jpg

Now you should see the destination folder you'll be installing Node.js to And you should click next again.

node ins 3.jpg

And then if you want to select the ways features are installed, but it's okay this way so you should just click next again.

node ins 4.jpg

And then it should bring another option to select if you want to install tools for native modules, to get a complete package it's recommended to install it to including chocolatey which is a package manager for windows, so you mark the checkbox and then click next again.

node ins 5.jpg

And now finally it should bring the installation button and you click next to start installation.

node ins 6.jpg

And then when the installation is done, a pop-up should come asking if you want to install additional tools so you just click any key and the installation should be complete, and now Node.js should be ready for use. To check if it's fully reachable on your Pc you can do that from your command prompt by typing 'node-v'.

node -v

And you should see the version of node you installed something like this.

node ins 8.jpg

so I said earlier that we can run JavaScript on Node.js let's test it out now, firstly you should type node in your command line and your JavaScript code.

node

2 + 2

in your command prompt and you should see something like this.

node ins 9.jpg

You can now run your JavaScript code here as this is an environment that supports it, wow you've come this far, Thank you for reading.