How to run Javascript in command prompt
- Wynn Teo
- Oct 11, 2017
- 1 min read

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. If you need to run a Javascript file in command prompt, you may need to install Node.js in your system.
After installed the Node.js, ensure it is configured in your system environment PATH.
Then run the command as below:
Take note, not to insert any window objects property in the script as you will hit ReferenceError: XXX is not defined eg. alert("");
Comments