how to run a .js file in command promt
In order to execute your test.js, open cmd.exe and type there: node test.js-that is the way to run node from files. â moka Jul 15 '13 at 13:18. add a comment |. up vote 4 down vote. You are trying to execute the program from the node prompt.You don't do that. You just run the node terminal.n order to execute your test.js, open cmd.exe and type there: node test.js-that is the way to run node from files. â moka Jul 15 '13 at 13:18. add a comment |. up vote 4 down vote. You are trying to execute the program from the node prompt. You don't do that.