@@ -89,33 +89,17 @@ steps:
8989 condition : and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))
9090 displayName : Setup NPM Authentication
9191
92- - powershell : |
93- mkdir -Force .build/node-gyp
94- displayName: Create custom node-gyp directory
95- condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
96-
97- - powershell : |
98- . ../../build/azure-pipelines/win32/exec.ps1
99- $ErrorActionPreference = "Stop"
100- # TODO: Should be replaced with upstream URL once https://github.com/nodejs/node-gyp/pull/2825
101- # gets merged.
102- exec { git config --global user.email "vscode@microsoft.com" } "git config user.email failed"
103- exec { git config --global user.name "VSCode" } "git config user.name failed"
104- exec { git clone https://github.com/nodejs/node-gyp.git . } "Cloning nodejs/node-gyp failed"
105- exec { git checkout v9.4.0 } "Checking out v9.4.0 failed"
106- exec { git am --3way --whitespace=fix ../../build/npm/gyp/patches/gyp_spectre_mitigation_support.patch } "Apply spectre patch failed"
107- exec { npm install } "Building node-gyp failed"
108- exec { python3 -m pip install setuptools } "Installing setuptools failed"
109- displayName: Install custom node-gyp
110- workingDirectory: .build/node-gyp
111- condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
112-
11392 - powershell : |
11493 . build/azure-pipelines/win32/exec.ps1
11594 . build/azure-pipelines/win32/retry.ps1
11695 $ErrorActionPreference = "Stop"
117- $env:npm_config_node_gyp="$(Join-Path $pwd.Path '.build/node-gyp/bin/node-gyp.js')"
118- $env:npm_config_arch="$(VSCODE_ARCH)"
96+ # TODO: remove custom node-gyp when updating to Node v20,
97+ # refs https://github.com/npm/cli/releases/tag/v10.2.3 which is available with Node >= 20.10.0
98+ $nodeGypDir = "$(Agent.TempDirectory)/custom-packages"
99+ mkdir "$nodeGypDir"
100+ npm install node-gyp@10.0.1 -g --prefix "$nodeGypDir"
101+ $env:npm_config_node_gyp = "${nodeGypDir}/node_modules/node-gyp/bin/node-gyp.js"
102+ $env:npm_config_arch = "$(VSCODE_ARCH)"
119103 $env:CHILD_CONCURRENCY="1"
120104 retry { exec { yarn --frozen-lockfile --check-files } }
121105 env:
0 commit comments