‘node’ is not recognized as an internal or external command VSCode
This error means Windows cannot find node.exe on your PATH, usually because Node.js is not installed. Install the current LTS (Node.js 26) from nodejs.org, keep the PATH option enabled, then open a new terminal or restart VS Code. Check it with node -v.
Short version
# 1. Install the Node.js LTS from https://nodejs.org/en/download
# 2. Open a NEW terminal (or restart VS Code) and check:
node -v
npm -v
I recently re-installed my Windows 10 machine and Visual Studio Code with it. All my extensions were gone too, and previously I have used the “Code Runner” extension to run JavaScript code directly in Visual Studio Code. I installed it, and when I tried to run my code I got the ‘node’ is not recognized as an internal or external command VSCode error message.
Gladly, the solution to this problem is very easy.
The ‘node’ is not recognized as an internal or external command VSCode FIX
The solution to the problem is simply installing Node.js. Node.js is necessary for Code Runner to run its magic. Simply go to the Node.js Website and download the current LTS version. The download page may look different from the screenshots below, but the steps are the same.
For most people the 64-bit Windows installer (.msi) is the right choice.
In the installer, simply keep everything as default and run through the routine.

Make sure the Add to PATH option is checked. The installer in the screenshot is an older version, so the current one may look a little different. Once the installation is done, restart your Visual Studio Code and try to run Code Runner again. Your problem now should be solved.
To confirm, open a new terminal in VS Code and run node -v. VS Code’s own Node.js tutorial says you need to open a new terminal for the node and npm commands to be on your PATH.

FAQ
Why do I still get the error after installing Node.js?
The terminal that VS Code started earlier still has the old PATH. Open a new terminal, or close and reopen VS Code completely, then run node -v. If it still fails, reinstall Node.js and make sure the Add to PATH option is enabled.
Does Code Runner need Node.js?
Yes, for JavaScript. Code Runner runs your file with an external executor, and its code-runner.executorMap setting maps JavaScript to the node command. Code Runner’s docs say to make sure each language’s executor is on your PATH.
Can I point Code Runner at a specific Node.js install?
Yes. Code Runner reads the code-runner.executorMap setting, and you can add an entry there to set the executor path. In settings.json it looks like this, with your own path to node.exe:
"code-runner.executorMap": {
"javascript": "\"C:\\path\\to\\node.exe\""
}Is there a similar error for npm?
Yes, 'npm' is not recognized has the same cause. npm is included in the Node.js distribution, so installing Node.js and opening a new terminal fixes both.
Can I run JavaScript in VS Code without Code Runner?
Yes. Open the integrated terminal and run node yourfile.js. You still need Node.js installed for that.
Conclusion
Visual Studio Code in combination with the Code Runner extension is a powerful tool to run your code within seconds. I really like the simplicity of Visual Studio Code.
More posts
All Web Development
