Node.js makes writing Event driven server side applications a piece of cake.
Do you remember Ghost Blogging Platform? It uses Node.js. In this article let us just focus on how to install node.js and write a one line code.
Install Node.js on Windows
Both the source code and the installers are available for Windows and Macintosh Operating systems in the official Node.js download section.
The Installer is available for both 32-bit and 64-bit operating systems. I picked the x64 version which is around 5.9 MB
Once you have downloaded the installer, double click to start installing Node.js on your machine.
- You should see the below setup screen, click Next
- Check the “I accept the terms in the License Agreement” check box and click Next.
- Provide the path where you would like the Node.js to be installed or just leave the default path as it is.
- In the Custom Setup Screen you can choose which components can be installed, as of now just leave this as it is and click Next.
- Click the Install button to start your Node.js installation
- Once the installation is completed you should see the below message displayed, click on the Finish button.
Your First Node.js Program
Hurray, you have completed the installation successfully, now go to the start menu and under Node.js folder click on Node.js executable which will bring the command prompt as shown below. Now let us see whether the Node.js installed on your system is working fine or not by trying out a simple line of code.
Now type the below code in the console window:
console.log(‘Hello Artic Post Readers’)
You can now press CTRL + D or CTRL + C to exit the Node.js console.
Now from the start menu, under Node.js folder click the Node.js command prompt
refer the below screenshot
Common Issues on Your First Node.js Program
You should see the below message returned by the console:
Invalid REPL keyword