From 0433e3ac261269ab2b2bff4d349501b7139c51f8 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 10 Jul 2026 14:20:55 +0000 Subject: [PATCH] build(workflows): skip stale `msvs_version` npm config on Node.js v18/v20 The job `test_npm_install` (Node.js v18 and v20 legs) on workflow `windows_test_npm_install` failed on every scheduled `develop` run for the past month with `npm error \`msvs_version\` is not a valid npm option`. Root cause: the `Configure npm` step unconditionally runs `npm config set msvs_version 2019`, but those two legs install npm v10+ (`NPM_VERSION: '>10.0.0'`), which validates config keys against a fixed schema and rejects the legacy `node-gyp` hint key that older npm releases accepted without validation. This commit adds an `if:` condition so the step is skipped for Node.js v18/v20, where the key is both unsupported and unnecessary (`node-gyp` bundled with npm v10+ auto-detects the installed Visual Studio toolset via `vswhere`). Ref: https://github.com/stdlib-js/stdlib/actions/runs/29010806701 --- .github/workflows/windows_test_npm_install.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/windows_test_npm_install.yml b/.github/workflows/windows_test_npm_install.yml index e2dcc6b773e0..73fdd4188970 100644 --- a/.github/workflows/windows_test_npm_install.yml +++ b/.github/workflows/windows_test_npm_install.yml @@ -259,7 +259,19 @@ jobs: timeout-minutes: 5 # Configure npm: + # + # ## Notes + # + # - `msvs_version` is a legacy `node-gyp` hint key. npm v10+ (used by + # Node.js v18 and v20 per `NPM_VERSION: '>10.0.0'` above) validates + # `npm config set` keys against a fixed schema and rejects + # unrecognized keys, so this step is skipped for those versions. + # Older npm releases accept the key without validation, and + # `node-gyp` bundled with npm v10+ auto-detects the installed + # Visual Studio toolset via `vswhere`, so the hint is unnecessary + # there. - name: 'Configure npm' + if: matrix.NODE_VERSION != '20' && matrix.NODE_VERSION != '18' run: | . "${{ env.NVS_HOME }}/nvs.sh" && nvs use ${{ matrix.NODE_VERSION }} npm config set msvs_version 2019