Error console is undefinied

when I want in command propmpt type index.js it show me microsoft jScript run time error, it should show Hello World but it doesn’t… can anyone help me why is that so, here is printscreen of what happens

You seem to be trying to run it using Microsoft’s ancient, obselete JScript.

If you want to run the file outside a browser, as a script, then it needs to be run using Node.

node my-file.js

would do that.

thank you, what now…

Two things:

  • When the instructions say
    Type ".help" for more information.
    They don’t mean to include the quotes around .help
  • Follow @DanCouper’s example, type the following on the command line:
    node index.js
    To execute the JS file in node. If that doesn’t work then you might not have node set up properly.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.