Use Node.js in Visual Studio Code

node-js

Updated August 29, 2026

Visual Studio Code does not install Node.js for you. Install Node on the operating system first, then let VS Code use the same executable as its integrated terminal.

  1. Install Node with a version manager or an official/package-manager distribution.
  2. Restart VS Code after changing PATH or switching Node versions.
  3. Open Terminal → New Terminal and check:
node --version
npm --version

Open a project folder, not just an individual file. If the project uses nvm, select the expected version before launching commands. The JavaScript and TypeScript language features built into VS Code are separate from the Node runtime used to run a file.

Run a file with node src/index.js or use an npm script. For debugging, add a JavaScript debug configuration only when the simple Run and Debug action does not provide the arguments you need. If the terminal sees Node but a task does not, inspect the task's shell and environment; it may have been started before your profile loaded.

Sources

related.

Ruslan Osipov

Ruslan Osipov

About the author