From 33269ef7e574500bafc0a53a60f85b0762d1ecc3 Mon Sep 17 00:00:00 2001 From: Even Stensberg Date: Wed, 26 Aug 2026 20:58:12 +0200 Subject: [PATCH] ci: skip lifecycle scripts when installing on legacy Node.js versions The legacy test lanes pin `typescript@4`, and `npm i` runs `prepare` -> `build` -> `build:types`. Recent `@types/node` releases ship `web-globals/streams.d.ts`, which only type-checks under TypeScript 5, so the install failed with TS2502 before any test could run. Those lanes only run Jest against `src`, so the build is not needed there. Co-Authored-By: Claude Opus 5 Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/nodejs.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 66c6848..bc25b03 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -76,9 +76,11 @@ jobs: architecture: ${{ steps.calculate_architecture.outputs.result }} cache: "npm" - name: Install dependencies + # Legacy versions do not generate types, so skip scripts that invoke `prepare` and explicitly run the code build without generating types run: | - npm i -D typescript@4 del-cli@^3 - npm i --ignore-engines + npm i -D typescript@4 del-cli@^3 --ignore-scripts + npm i --ignore-engines --ignore-scripts + npm run build:code if: matrix.node-version == '10.x' || matrix.node-version == '12.x' || matrix.node-version == '14.x' || matrix.node-version == '16.x' || matrix.node-version == '18.x' - name: Install dependencies run: npm ci