How to Run a Node.js Application on Windows

See JavaScript: Tips and Tricks for similar articles.

Node.js makes it possible for you to run JavaScript programs outside of a web browser or on a server. To run a Node.js application on Windows, follow these three steps.

  1. Locate Command Prompt by entering cmd into the search bar. Click cmd in the search results to open the Command Prompt.Opening the Command Prompt
  2. Enter the following command, then press Enter to create a file named test-node.js containing a simple application that will print out the result 1 + 1.
    echo console.log(1+1); >> test-node.js
  3. Type node followed by the name of the application, which is test-node.js in this case, and then press Enter.
    node test-node.js
    The result of running the application will be printed out to the command prompt.Result of Running the Application

Related Articles

  1. A Step-by-Step Guide to Installing nvm-windows for Node.js Management
  2. Node.js and Node Package Manager (npm)
  3. How to Install Node.js on a Mac
  4. How to Run a Node.js Application on Windows (this article)
  5. How to Send and Receive JSON Data to and from the Server
  6. How to Run a Node.js Application on a Mac
  7. How to Open Google Chrome's JavaScript Console
  8. How to Create a Google Map Object with the Maps JavaScript API
  9. Why JavaScript is called JavaScript
  10. How to Learn JavaScript on Your Own
  11. How to Install Node.js on Windows