Peter Hull
Peter Hull

Reputation: 7067

How can I find which version of node ships with each version of Visual Studio Code

Is there a list of VScode versions together with the version of Node it comes with (in the extension host?)

The reason is, in package.json we must specify the engines.vscode value and also in devDependencies I have a reference to @types/node and @types/vscode. I want these all to match up, so that when I am developing an extension I don't use node APIs which won't be available when running in the editor.

I can find the version of node that my VSCode is running (via Help|About) but if I want to support earlier versions of VScode that info isn't obvious.

[edit] to address the comment from rioV8

As I understand it, engines.vscode determines the version or range of versions of the editor that will be able to install the extension. The entries in devDependencies (since they are only type definitions) affect the typescript compiler while I am developing.

Even now, if I target the latest version of vscode, it does not include the latest verson of node, so if I just use npm to install @types/node it will allow me to develop with use APIs which will subsequently fail when the extension is launched. In this case it's easy to use Help | About and get the version of node.

However, it would be good to set engine.vscode to the earliest version that would support my extension. In that case I also need to select the corresponding node version, and I don't know how to find that info.

As an example, my current vscode is 1.51.1 which comes with node 12.14.1. If I wanted to target 1.45, which version of node comes with that?

Upvotes: 5

Views: 2061

Answers (3)

EcksDy
EcksDy

Reputation: 1654

I've landed at this question page one too many times :)

I've developed VSCode Version Matrix github action (source code), to help me get it on the fly in my pipeline runs.
This might be handy for people who are testing their VSCode extensions in Github Actions.

Upvotes: 1

lepsch
lepsch

Reputation: 10319

Edit: There's a new repo with version table: https://github.com/ewanharris/vscode-versions

One way to find which version of NodeJS ships with each version of VSCode is to check the Electron version being bundled with it. For example, VSCode version 1.51.1 installs Electron 9.3.3 and this Electron version uses Node version 12.14 as you can see at the electron releases table.

Below are the Node/Electron versions VSCode uses on each version for easy reference:

VSCode Node Electron Chrome
1.75.x 16.14.2 19.1.9 102.0.5005.194
1.74.x 16.14.2 19.1.8 102.0.5005.167
1.73.x 16.14.2 19.0.17 102.0.5005.167
1.72.x 16.14.2 19.0.17 102.0.5005.167
1.71.x 16.14.2 19.0.12 102.0.5005.167
1.70.x 16.13.2 18.3.5 100.0.4896.160
1.69.x 16.13.2 18.3.5 100.0.4896.160
1.68.x 16.13.0 17.4.7 98.0.4758.141
1.67.x 16.13.0 17.4.1 98.0.4758.141
1.66.x 16.13.0 17.2.0 98.0.4758.109
1.65.x 14.16.0 13.5.2 91.0.4472.164
1.64.x 14.16.0 13.5.2 91.0.4472.164
1.63.x 14.16.0 13.5.2 91.0.4472.164
1.62.x 14.16.0 13.5.2 91.0.4472.164
1.61.x 14.16.0 13.5.1 91.0.4472.164
1.60.x 14.16.0 13.1.8 91.0.4472.164
1.59.x 14.16.0 13.1.7 91.0.4472.124
1.58.x 14.16.0 12.0.13 89.0.4389.128
1.57.x 14.16.0 12.0.7 89.0.4389.128
1.56.x 14.16.0 12.0.4 89.0.4389.114
1.55.x 12.18.3 11.3.0 87.0.4280.141
1.54.x 12.18.3 11.3.0 87.0.4280.141
1.53.x 12.18.3 11.2.1 87.0.4280.141
1.52.x 12.14.1 9.3.5 83.0.4103.122
1.51.x 12.14.1 9.3.3 83.0.4103.122
1.50.x 12.14.1 9.2.1 83.0.4103.122
1.49.x 12.14.1 9.2.1 83.0.4103.122
1.48.x 12.8.1 7.3.2 78.0.3904.130
1.47.x 12.8.1 7.3.2 78.0.3904.130
1.46.x 12.8.1 7.3.1 78.0.3904.130
1.45.x 12.8.1 7.2.4 78.0.3904.130
1.44.x 12.8.1 7.1.11 78.0.3904.130
1.43.x 12.8.1 7.1.11 78.0.3904.130
1.42.x 12.4.0 6.1.6 76.0.3809.146
1.41.x 12.4.0 6.1.6 76.0.3809.146
1.40.x 12.4.0 6.1.6 76.0.3809.146
1.39.x 10.11.0 4.2.10 69.0.3497.128
1.38.x 10.11.0 4.2.10 69.0.3497.128
1.37.x 10.11.0 4.2.10 69.0.3497.128
1.36.x 10.11.0 4.2.10 69.0.3497.128
1.35.x 10.2.0 3.1.8 66.0.3359.181
1.34.x 10.2.0 3.1.8 66.0.3359.181
1.33.x 10.2.0 3.1.6 66.0.3359.181
1.32.x 10.2.0 3.1.6 66.0.3359.181
1.31.x 10.2.0 3.1.2 66.0.3359.181
1.30.x 8.9.3 2.0.12 61.0.3163.100
1.29.x 8.9.3 2.0.12 61.0.3163.100
1.28.x 8.9.3 2.0.9 61.0.3163.100
1.27.x 8.9.3 2.0.7 61.0.3163.100
1.26.x 8.9.3 2.0.5 61.0.3163.100
1.25.x 7.9.0 1.7.12 58.0.3029.110

To easily check which version ships with VSCode just take a look at the .yarnrc file in the root folder of VSCode source code and select the version tag in the Switch branches or tags on GitHub.

Upvotes: 7

Peter Hull
Peter Hull

Reputation: 7067

(answering my own question)

I looked at what the Yeoman generator for vscode does. It (as of version 1.3.7)

  • Accesses a MS website to latest version number, and puts this into engines.vscode and @types/vscode as the minimum version.
  • Hardcodes ^12.11.7 in to @types/node

So I'm just going to do that for now, and not worry about backward compatibility. This is OK because I believe most people auto-update the editor whenever a new version is made available.

It looks like there is no version cross-reference table like I was describing.

Upvotes: 0

Related Questions