14

Refering to the homepage and the documentation, I installed node.js, created example.js and ran the script. But I got 3 dots (...) and nothing else. Where should I look?

> node example.js
...

Running this on Windows 7 x64

Jake
  • 10,633
  • 20
  • 79
  • 134
  • Do you mean the example node http server of "Hello World". `> node example.js Server running at http://127.0.0.1:8124/`? Is this? – atupal Dec 24 '13 at 07:19
  • @atupal I just updated my question. Thanks. Yes, I was expecting the console.log message, but it did not appear. Where should I put the example.js file? Even after specifying the full path D:/path/to/example.js it did not work. – Jake Dec 24 '13 at 07:23
  • maybe [this question](http://stackoverflow.com/questions/6737824/how-to-run-a-hello-js-file-in-node-js-on-windows) is helpful. :) – atupal Dec 24 '13 at 07:26
  • You can type ".load example.js" in node REPL :) – damphat Dec 24 '13 at 08:33

1 Answers1

21

It appears that you have run node.exe, which opens a terminal, and have typed node example.js into that terminal.

So basically, you opened node in an interactive terminal, and then typed node example.js, so it is trying to run that as if it were JavaScript. It shows the three dots because that is not valid JavaScript code, and it is waiting for you to type more code that might make it valid.

You should be running node.exe example.js from a cmd prompt, where you'd see a prompt more like C:\>.

loganfsmyth
  • 135,356
  • 25
  • 296
  • 231