Skip to content

Commit 72afe47

Browse files
committed
chore: set the latest VSCode node version to be based on the VSCode repo
1 parent 21367c5 commit 72afe47

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

.evergreen.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4105,15 +4105,14 @@ functions:
41054105
working_dir: src
41064106
shell: bash
41074107
env:
4108-
# Node version used by VSCode 1.105.1
4109-
# TODO: Look into automatically getting this for the latest version.
4110-
NODE_JS_VERSION: "22.19.0"
41114108
DOCKERHUB_USERNAME: ${dockerhub_username}
41124109
DOCKERHUB_PASSWORD: ${dockerhub_password}
41134110
script: |
41144111
set -e
41154112
{
4116-
echo "Using Node.js version: ${NODE_JS_VERSION}"
4113+
# Fetch Node.js version from VS Code's .nvmrc to ensure we test with the same version
4114+
NODE_JS_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]')
4115+
echo "Using Node.js version from VS Code .nvmrc: ${NODE_JS_VERSION}"
41174116
(cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .)
41184117
docker run \
41194118
--rm -v $PWD:/tmp/build ubuntu24.04-xvfb \

.evergreen/evergreen.yml.in

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,14 @@ functions:
324324
working_dir: src
325325
shell: bash
326326
env:
327-
# Node version used by VSCode 1.105.1
328-
# TODO: Look into automatically getting this for the latest version.
329-
NODE_JS_VERSION: "22.19.0"
330327
DOCKERHUB_USERNAME: ${dockerhub_username}
331328
DOCKERHUB_PASSWORD: ${dockerhub_password}
332329
script: |
333330
set -e
334331
{
335-
echo "Using Node.js version: ${NODE_JS_VERSION}"
332+
# Fetch Node.js version from VS Code's .nvmrc to ensure we test with the same version
333+
NODE_JS_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]')
334+
echo "Using Node.js version from VS Code .nvmrc: ${NODE_JS_VERSION}"
336335
(cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .)
337336
docker run \
338337
--rm -v $PWD:/tmp/build ubuntu24.04-xvfb \

scripts/docker/ubuntu24.04-xvfb.Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
FROM ubuntu:24.04
22

3-
ARG NODE_JS_VERSION
4-
ENV NODE_JS_VERSION=${NODE_JS_VERSION}
53
ENV DEBIAN_FRONTEND=noninteractive
64
RUN apt-get update
75
RUN apt-get -y -qq install git curl apt-transport-https ca-certificates apt-utils software-properties-common
86

9-
# Install Node.js using nvm (reusing pattern from .evergreen/install-node.sh)
7+
# Install Node.js using nvm with version from VS Code's .nvmrc
8+
# This ensures we test with the same Node.js version that VS Code uses
109
ENV NVM_DIR="/root/.nvm"
1110
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash && \
1211
. "$NVM_DIR/nvm.sh" && \
1312
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \
14-
nvm install --no-progress $NODE_JS_VERSION && \
15-
nvm alias default $NODE_JS_VERSION && \
16-
nvm use $NODE_JS_VERSION
13+
NODE_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]') && \
14+
echo "Installing Node.js version from VS Code .nvmrc: $NODE_VERSION" && \
15+
nvm install --no-progress $NODE_VERSION && \
16+
nvm alias default $NODE_VERSION && \
17+
nvm use $NODE_VERSION && \
18+
echo "export NVM_DIR=\"$NVM_DIR\"" >> /root/.bashrc && \
19+
echo "export PATH=\"$NVM_DIR/versions/node/v${NODE_VERSION}/bin:\$PATH\"" >> /root/.bashrc
1720

18-
# Set PATH so node/npm are available in all contexts
19-
ENV PATH="$NVM_DIR/versions/node/v${NODE_JS_VERSION}/bin:$PATH"
21+
# Set PATH so node/npm are available in all contexts (using wildcard since we don't know the version at Docker ENV time)
22+
RUN bash -c ". $NVM_DIR/nvm.sh && ln -sf \$(which node) /usr/local/bin/node && ln -sf \$(which npm) /usr/local/bin/npm"
2023

2124
# Install vscode dependencies
2225
RUN apt-get -y -qq install libnss3 gnupg libxkbfile1 libsecret-1-0 libsecret-1-dev libgtk-3-0t64 libxss1 libgbm1 libasound2t64 xvfb build-essential pkg-config

0 commit comments

Comments
 (0)