I have installed node-v0.10.13-x86.msi from nodejs.org
I have a file test.js having path (d:\BNB\test.js)
test.js:
console.log("Hello world!");
I am able to run test.js from my cmd but not from node.js command prompt refer below screenshot
From start > run > cmd (working)
From Node.exe (not working)
Node.exe is application that can be used to run code from file, or to be ran by it self that way it will behave like live-terminal.
Once you run node.exe like you did in second example, you will end up in node environment and everything from there is not cmd at all, but JS.
If you type: node example.js
that will call node environment and will execute file in that environment.
Although, running node.exe is the same as typing node
in cmd.
in node REPL you could type
require('d:\\BNB\\test')
that shuold run your file..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With