node.js - Unexpected Identifier in Node js beginner program -
this simple code in main.js
/* hello, world! program in node.js */ console.log("hello, world!")
when execute $ node main.js error unexpected identifier ?
you trying execute program within node repl itself, wrong. have execute node program name terminal/command prompt/shell not within node itself.
starting node alone run repl, can execute javascript commands directly. can type console.log("hello, world");
inside repl.
Comments
Post a Comment