I have a javascript file hello.js with console.log("Hello World")
. I want to run it from my terminal (I am on a mac). I have node installed and I take the following steps -
- Open terminal and navigate to the directory where hello.js exists.
- Run command "node hello.js"
But I dont see the console statement (Hello World) in my terminal.
Can some one please help me run javascript from terminal (or tell me what I am doing wrong) ?
PS: I have checked this thread but my problem still exists.