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
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!

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!
- Go to official website: https://nodejs.org
- Click button to download LTS (Long Term Support) version.
- Open downloaded
.msisetup file, click Next > accept license > click Install. - 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 -vto 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:
- Create a new folder on your computer (example:
D:\js-projects). - Inside folder, create a new text file and rename it to
app.js(make sure file extension is.js, not.js.txt!). - Open
app.jswith 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.txtfiles by mistake!
Step 3: Run JavaScript File in Command Prompt or Terminal
Open terminal inside your project folder and run your JavaScript file:
- Open Command Prompt or PowerShell.
- Navigate to your project folder:
cd D:\js-projects
- Run your JavaScript file using
nodecommand:
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
nodein terminal without file name and press Enter. Now you can test any JavaScript code line-by-line! Type.exitor pressCtrl + Ctwice to stop!
Step 4: Run JavaScript inside VS Code Terminal
VS Code is the best code editor for JavaScript developers!
- Open VS Code > click File > Open Folder... > select your
D:\js-projectsfolder. - Open built-in terminal in VS Code by pressing shortcut key
Ctrl + ~(tilde key under Esc). - Type command below in VS Code terminal:
node app.js
💡 Tip: Install Code Runner extension in VS Code! After install, just open your
.jsfile and pressCtrl + 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!