Getting Started With NodeJs

In this blog, we will come to know about checking if NodeJs is properly installed in your system and then we will run a small piece of code on NodeJs.

Testing Node: To check if Node is installed properly on your system, open the terminal or command prompt and run command node -v . This should print the version, so it will show you something like this v4.5.0.

c:\node> node -v

Create a test file and run it: This is the easiest way to check if Node.js is installed on your system. Create a simple JavaScript file and run it with node. Create JavaScript file and name it test.js and just add simple JavaScript code in the file.

console.log(“Hey! Node is working properly.”)

To run this code simply open the terminal or command prompt. Navigate to
the folder where you created the test.js file.

And run the command node test.js. You will see the output on the terminal.
Hey! Node is working properly

c:\node> node test.js
Hey! Node is working properly.

If you can see the output then Node is working properly in your system.

Leave a Reply

%d bloggers like this: