When I use the Remote Extension in vscode, I get a .vscode-server directory. Inside, I can find a node executable, e.g. in ~/.vscode-server/some-random-string/node.
I figured this out by testing the following minimal vscode extension:
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
let disposable = vscode.commands.registerCommand('test.helloworld', () => {
vscode.window.showInformationMessage(process.argv[0]);
});
context.subscriptions.push(disposable);
}
export function deactivate() {}
Running the same extension without the Remote extension, e.g. within Windows, the same extension would show me that I am running vscode from:
C:\Users\username\AppData\Local\Programs\Microsoft VS Code\Code.exe
My question is: is there a node executable available somewhere within vscode (not using Remote Extension) and how to find its path reliably from a vscode extension?
This is what I see in the Microsoft VS Code directory:
Directories:
- bin
- locales
- policies
- resources
- tools
as well as the Code.exe, and other irrelevant files. I looked everywhere but couldn't find any node executable.
There is also a ~/.vscode directory in my home folder, where you can find extensions, and an empty cli folder.
-
I have no authoritative answer for your question, but I think there's no Node.js. Instead VS Code is based on Electron, which is itself a native binary and provides the necessary APIs for accessing the OS resources like disks, IO and so on.Mike Lischke– Mike Lischke2023年12月08日 07:49:40 +00:00Commented Dec 8, 2023 at 7:49
1 Answer 1
It seems the answer is no:
Visual Studio Code has support for the JavaScript and TypeScript languages out-of-the-box as well as Node.js debugging. However, to run a Node.js application, you will need to install the Node.js runtime on your machine.
Note that the node executable in the Remote environment appears to be installed by the vscode server service.
1 Comment
Explore related questions
See similar questions with these tags.