The solution is to set alias default. In the OS terminal run -
nvm alias default 7.8.0
Open vscode, now running node -v returns 7.8.0
It seems vscode takes up this (alias default) value and not the node version that is set by nvm use X.X.X
Restart VS code for it to pick up the changes.
Answer from A G on Stack OverflowThe solution is to set alias default. In the OS terminal run -
nvm alias default 7.8.0
Open vscode, now running node -v returns 7.8.0
It seems vscode takes up this (alias default) value and not the node version that is set by nvm use X.X.X
Restart VS code for it to pick up the changes.
In VS Code:
- go to your
launch.jsonfile - add the
runtimeVersionattribute inside configurations as shown below
In this example, we are assuming 4.8.7 is already installed using nvm:
{
"version": "<some-version>",
"configurations": [
{
"type": "node",
"runtimeVersion": "4.8.7", // If i need to run node 4.8.7
"request": "launch",
"name": "Launch",
"program": "${workspaceFolder}/sample.js"
}
]}
Videos
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.
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.
Hi all. If I open VSCode-->Help-->About, it indicates:
Node.js: 12.14.1
But if I check the version of my installed Node (by executing node -v from my command prompt), it indicates
v14.15.1
(screenshot) Why is there a discrepancy? Is the first not an indication of my installed Node version?
Thanks in advance?