2

I am quite new to Node.js and i am facing problem in running a simple 'hello world' program in Node.js

program1:

console.log("hello world");

program2:

var http = require('http');

http.createServer(function (request, response) {
    response.writeHead(200, {'Content-Type': 'text/plain'});
    response.end('Hello World\n');
}).listen(8124);

console.log('Server running at http://127.0.0.1:8124/');

After running both the programs,this is how the terminal continues looks:

>node hello.js
...
2
  • If you're using Windows 7 this post is a duplicate of stackoverflow.com/questions/8553937/… Commented Apr 26, 2013 at 12:26
  • well i am using windows 8. Commented Apr 27, 2013 at 13:59

1 Answer 1

4

You have written the following command in the node js command prompt

node hello.js

You are getting dots (....) in the terminal because you are not giving the complete path of the hello.js file.

try this, For Example assume that the path of your hello.js file is C:\files\hello.js

so,

node C:\files\hello.js

This will display proper "Hello world" message for your Program 1. This may resolve your issue.

Regards

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.