NodeJS : Get Starting With NodeJS on Windows Xp For Newbie
1. Download Node server from http://nodejs.org/
2. Once the installation is completed, the folder structure looks like as follows and installation path in my system is "C:\Program Files\nodejs"
3. To write Your first "Hello World" program, create a folder namely "node_builds" within "C:\Program Files\nodejs". Let’s use this folder like "www in Wamp server" or "htdocs in Xampp Server". Of course, NodeJs allow us to keep Your project anywhere in local system, always keep right folder structure would be better.
4. Now create a project folder namely "helloworld_proj". And then create a javascript file namely "index.js" within Your project folder and write following code in it.
5. To run your "Hello World" program, go to DOS-command prompt and then set the base path of command prompt to your project folder by typing the command >cd "C:\Program Files\nodejs\node_builds\helloworld_proj". Now your command prompt would be
6. Now start node server by typing the command >node index.js . And then you gets log message which shows in above piece of code.
7. Now your server is running. Then go to browser and type the url "http://127.0.0.1:1337/" which is currently listening by our node server. Now your browser says "Hello World"
1. Download Node server from http://nodejs.org/
2. Once the installation is completed, the folder structure looks like as follows and installation path in my system is "C:\Program Files\nodejs"
3. To write Your first "Hello World" program, create a folder namely "node_builds" within "C:\Program Files\nodejs". Let’s use this folder like "www in Wamp server" or "htdocs in Xampp Server". Of course, NodeJs allow us to keep Your project anywhere in local system, always keep right folder structure would be better.
4. Now create a project folder namely "helloworld_proj". And then create a javascript file namely "index.js" within Your project folder and write following code in it.
5. To run your "Hello World" program, go to DOS-command prompt and then set the base path of command prompt to your project folder by typing the command >cd "C:\Program Files\nodejs\node_builds\helloworld_proj". Now your command prompt would be
6. Now start node server by typing the command >node index.js . And then you gets log message which shows in above piece of code.
7. Now your server is running. Then go to browser and type the url "http://127.0.0.1:1337/" which is currently listening by our node server. Now your browser says "Hello World"
Note: Please leave your queries and suggestion as comment.
Thank you, deeply appreciated, worked first time
ReplyDeletethe above steps are not working for me, Could you please help me out on this:
ReplyDeletethe following is the error:
C:\Program Files\nodejs\node_builds\elloworld_proj>node Index.js
Server running at http://127.0.0.1:1337/
events.js:66
throw arguments[1]; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:782:11)
at Server._listen2 (net.js:921:14)
at listen (net.js:948:10)
at Server.listen (net.js:1006:9)
at dns.js:71:18
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
Hi friend,
DeleteThis is normal. Your port(1337) might be used by some other process. So change your port number in listen(<Port Number Here>, "127.0.0.1") function and try again.
Great thanks to shared your question.
great effort and easy example.
ReplyDeletethanks buddy keep it up
g8 nice ! thank good work easy and simple !
ReplyDeleteNice tutorial to start
ReplyDeletethank you.. worked perfectly :)
ReplyDeleteAmazing post
ReplyDeleteHey, Wow Provided Post will be Very much Informative to the People Who Visit this Site. Good Work! Thank You for Sharing.
ReplyDeleteJoomla training in chennai
Not the style but rather type. Sort is characterized as material used to make the windows which are normally wood, metal or vinyl and is either a substitution or prime window. cost of solar
ReplyDeleteWonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging!
ReplyDeleteWeb Design Training
What material is directly for your new house windows? Numerous individuals swear by PVC, as UPVC windows establish a decent connection and spruce up your home. windows xp iso download
ReplyDeletesmart outsourcing solutions is the best outsourcing training
ReplyDeletein Dhaka, if you start outsourcing please
visit us: outsourcing training in bangladesh