0

I am trying to get node.js working now therefore I try to write a simple test function in JavaScript and name it score.js.

var score = 61;

if (score >= 60)
    console.log("pass");
else
    console.log("failed");

I try to run this but this happenedenter image description here

How may i fix this issue?

1
  • 1
    try using this command : node score.js Commented May 27, 2015 at 4:24

1 Answer 1

2

You have to execute your scripts using the node executable, like: node score.js. Otherwise Windows will try to execute your javascript file with Microsoft's JScript implementation, which is very different.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.