dev.rean.me
javascript

02 - How to Run JavaScript on Windows using Command, Terminal & VS Code (Video in Khmer)

Learn how to run JavaScript code on Windows using Node.js, Command Prompt (CMD), PowerShell, and VS Code step-by-step with video tutorial in Khmer.

2026-08-27 · 3 min read

Share:

Hello my friend! Today I show you step-by-step how to Run JavaScript on Windows using Node.js, Command Prompt (CMD), PowerShell, and VS Code! Very easy to follow with code steps and video tutorial in Khmer! Let's get started!

How to Run JavaScript on Windows Command Terminal VS Code speak khmer

Step 1: Download & Install Node.js on Windows

Browser can run JavaScript inside web page, but if you want to run JavaScript directly on Windows desktop or terminal, your computer need Node.js runtime environment!

  1. Go to official website: https://nodejs.org
  2. Click button to download LTS (Long Term Support) version.
  3. Open downloaded .msi setup file, click Next > accept license > click Install.
  4. When install finish, open Command Prompt (CMD) or PowerShell and verify with command:
node -v

If terminal show version (like v20.17.0), Node.js is installed 100% working on your computer!

💡 Tip: Always download Node.js LTS (Long Term Support) version for stable performance! Also check npm -v to make sure npm package manager working properly!


Step 2: Create Your First JavaScript File (app.js)

Now let's create a JavaScript file on your computer:

  1. Create a new folder on your computer (example: D:\js-projects).
  2. Inside folder, create a new text file and rename it to app.js (make sure file extension is .js, not .js.txt!).
  3. Open app.js with Notepad or VS Code and paste code below:
// app.js
console.log("Hello my friend! JavaScript is running on Windows!");

const a = 10;
const b = 20;
console.log("Sum result is: " + (a + b));

💡 Tip: In Windows Explorer, click View tab > check box File name extensions! This helps you avoid creating hidden .js.txt files by mistake!


Step 3: Run JavaScript File in Command Prompt or Terminal

Open terminal inside your project folder and run your JavaScript file:

  1. Open Command Prompt or PowerShell.
  2. Navigate to your project folder:
cd D:\js-projects
  1. Run your JavaScript file using node command:
node app.js

You will see output in terminal:

Hello my friend! JavaScript is running on Windows!
Sum result is: 30

💡 Tip: You can also run Node REPL mode directly! Type node in terminal without file name and press Enter. Now you can test any JavaScript code line-by-line! Type .exit or press Ctrl + C twice to stop!


Step 4: Run JavaScript inside VS Code Terminal

VS Code is the best code editor for JavaScript developers!

  1. Open VS Code > click File > Open Folder... > select your D:\js-projects folder.
  2. Open built-in terminal in VS Code by pressing shortcut key Ctrl + ~ (tilde key under Esc).
  3. Type command below in VS Code terminal:
node app.js

💡 Tip: Install Code Runner extension in VS Code! After install, just open your .js file and press Ctrl + Alt + N (or click ▶️ Play button top right) to run JavaScript instantly without typing commands!


Watch Video Tutorial (Khmer)

Watch full step-by-step video tutorial below to see complete setup and demo in Khmer:


Hope this tutorial help you run JavaScript on Windows easily! Practice writing code and running node app.js today. Happy learning my friends! Sharing is caring!

← Back to javascript
Share: