Skip to content

fix(ci): fix check-node.yml matrix incompatibility with engine-strict=trueΒ #892

@beatrizsmerino

Description

@beatrizsmerino

fix(ci): fix check-node.yml matrix incompatibility with engine-strict=true

⏱️ Estimate πŸ“Š Priority πŸ“ Size πŸ“… Start πŸ“… End
1h P0 S 12-03-2026 12-03-2026

πŸ“Έ Screenshots

Current Expected
Image Image N/A β€” This change has no visual impact.

πŸ“ Summary

  • No .noderc.json exists in this repo
  • Add deploy.yml to update-node-npm.yml automated workflow
  • Fix check-node.yml matrix from [22, 24] to [24.14.0]
  • Update update-node-npm.yml to propagate exact versions

πŸ’‘ Why this bug?

Caution

Run npm install
npm error code EBADENGINE
npm error engine Unsupported engine
npm error engine Not compatible with your version of node/npm: vue-editor@3.5.0
npm error notsup Not compatible with your version of node/npm: vue-editor@3.5.0
npm error notsup Required: {"node":"24.14.0","npm":"11.9.0"}
npm error notsup Actual:   {"npm":"10.9.4","node":"v22.22.0"}
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2026-03-12T06_44_04_160Z-debug-0.log
Error: Process completed with exit code 1.
  • No .noderc.json exists in this repo, but if it did, the update-node-npm.yml workflow would not be able to update to newer LTS versions because .noderc.json sets maxMajorVersion, restricting updates to that major version
  • The deploy.yml was never included in the update-node-npm.yml automated workflow, leaving its node-version outdated at 20.x
  • check-node.yml tests [22, 24] causing release(3.5.0): license, configuration and dependency improvementsΒ #891 to fail CI with EBADENGINE errors on Node 22. Reducing to [24] still fails because engine-strict=true requires exactly 24.14.0

βœ… Expected behavior

  • update-node-npm.yml updates all workflow files (including deploy.yml) to the latest LTS version without restrictions
  • CI passes with a single Node version matching engines.node

πŸ“‹ Steps

Phase 0: Verify next LTS compatibility

N/A β€” No .noderc.json exists in this repo and the project is already running on Node 24. If a .noderc.json existed with a maxMajorVersion restriction, the next LTS version should be tested before removing it:

  • Switch to the next LTS:
nvm install <next-lts>
nvm use <next-lts>
  • Run install:
npm install
  • Run build:
npm run build
  • Run dev:
npm run dev

Phase 1: Remove maxMajorVersion restriction

N/A β€” No .noderc.json exists in this repo. If it did and no maximum version restriction is needed, it should be deleted so the update-node-npm.yml workflow can update to the latest LTS version freely:

rm .noderc.json
- {
- 	"maxMajorVersion": 22
- }

Phase 2: Add deploy.yml support to update-node-npm.yml

  • Add deploy.yml to the header comment in update-node-npm.yml:
 # Files updated by this workflow:
 # - .nvmrc
 # - package.json (engines.node and engines.npm)
 # - .github/workflows/check-node.yml (matrix node-version)
+# - .github/workflows/deploy.yml (node-version)
  • Add step in update-node-npm.yml to also update node-version in deploy.yml:
      - name: πŸ“ Update check-node.yml matrix
        if: steps.check-update.outputs.update_needed == 'true' && steps.current-versions.outputs.has_node_yml == 'true'
        run: |
          ...
+
+     - name: πŸ“ Update deploy.yml node-version
+       if: steps.check-update.outputs.update_needed == 'true'
+       run: |
+         sed -i "s/node-version: [0-9]*\.x/node-version: ${{ steps.node-versions.outputs.lts_latest }}.x/" .github/workflows/deploy.yml
+         echo "Updated deploy.yml node-version"
+         grep "node-version:" .github/workflows/deploy.yml
+
      - name: πŸš€ Create Pull Request
        ...
  • Add deploy.yml reference to the commit message in update-node-npm.yml:
            - Update `check-node.yml` file in matrix: ... β†’ ...
+           - Update `deploy.yml` file in node-version: ...
          title: ...
  • Add deploy.yml reference to the PR body in update-node-npm.yml:
            - Update `check-node.yml` file in matrix: `...` β†’ `...`
+           - Update `deploy.yml` file in node-version: `...`

            ## πŸ§ͺ Tests
  • Add DEPLOY_YML_ICON variable and deploy.yml row to the Summary step in update-node-npm.yml:
          if [ "${{ steps.current-versions.outputs.has_node_yml }}" == "true" ]; then
            NODE_YML_ICON="βœ… Found"
          else
            NODE_YML_ICON="❌ Not found"
          fi
+
+         if [ -f .github/workflows/deploy.yml ]; then
+           DEPLOY_YML_ICON="βœ… Found"
+         else
+           DEPLOY_YML_ICON="❌ Not found"
+         fi
          | \`check-node.yml\` | ${NODE_YML_ICON} | CI workflow matrix |
+         | \`deploy.yml\` | ${DEPLOY_YML_ICON} | Deploy workflow node-version |

Phase 3: Update deploy.yml node-version

  • Update deploy.yml from 20.x to 24.x to match the current major version:
      - name: πŸ› οΈ Setup Node version
        uses: actions/setup-node@v6.3.0
        with:
-          node-version: 20.x
+          node-version: 24.x

Phase 4: Address check-node.yml matrix issue

With engine-strict=true and an exact version in engines, only one Node version can pass CI. The original purpose of testing multiple versions is incompatible with strict engine enforcement:

// package.json
"engines": {
  "node": "24.14.0",
  "npm": "11.9.0"
}
# check-node.yml
matrix:
  node-version: [22, 24]

check-node.yml

  • Option A: Remove the matrix and test only the current major version:
 strategy:
   matrix:
-    node-version: [22, 24]
+    node-version: [24]

.npmrc

  • Option B: Remove engine-strict=true from .npmrc to allow multiple versions β€” Discarded
- engine-strict=true

Phase 5: Pin exact versions

Workflows were using major version (24) or wildcard (24.x) which resolves to whatever the runner has. With engine-strict=true, this causes CI failures when the runner lags behind the exact engines.node version. All workflows must use exact versions, and update-node-npm.yml must propagate them.

check-node.yml

  • Update matrix from [24] to [24.14.0]:
 strategy:
   matrix:
-    node-version: [24]
+    node-version: [24.14.0]

deploy.yml

  • Update node-version from 24.x to 24.14.0:
      - name: πŸ› οΈ Setup Node version
        uses: actions/setup-node@v6.3.0
        with:
-          node-version: 24.x
+          node-version: 24.14.0

update-node-npm.yml

  • Update the matrix output to generate a single exact version, preventing the workflow from reverting the fix:
      - name: πŸ” Determine matrix versions
        id: matrix-versions
        run: |
-         echo "matrix=[ $LTS_OLDEST, $LTS_LATEST ]" >> $GITHUB_OUTPUT
+         echo "matrix=[$LATEST_VERSION]" >> $GITHUB_OUTPUT
  • Update deploy.yml sed pattern to match and replace exact versions:
      - name: πŸ“ Update deploy.yml node-version
        if: steps.check-update.outputs.update_needed == 'true'
        run: |
-          sed -i "s/node-version: [0-9]*\.x/node-version: ${{ steps.node-versions.outputs.lts_latest }}.x/" .github/workflows/deploy.yml
+          sed -i "s/node-version: [0-9][0-9.]*/node-version: ${{ steps.node-versions.outputs.latest_version }}/" .github/workflows/deploy.yml
           echo "Updated deploy.yml node-version"
           grep "node-version:" .github/workflows/deploy.yml
  • Update commit message reference from wildcard to exact version:
            - Update `check-node.yml` file in matrix: ... β†’ ...
-            - Update `deploy.yml` file in node-version: ${{ steps.node-versions.outputs.lts_latest }}.x
+            - Update `deploy.yml` file in node-version: ${{ steps.node-versions.outputs.latest_version }}
          title: ...
  • Update PR body reference from wildcard to exact version:
            - Update `check-node.yml` file in matrix: `...` β†’ `...`
-            - Update `deploy.yml` file in node-version: `${{ steps.node-versions.outputs.lts_latest }}.x`
+            - Update `deploy.yml` file in node-version: `${{ steps.node-versions.outputs.latest_version }}`

            ## πŸ§ͺ Tests

Phase 6: Close related PR

πŸ§ͺ Tests

  • Verify update-node-npm.yml workflow runs successfully
  • Verify deploy.yml is updated when update-node-npm.yml runs
  • Run install locally:
npm install
  • Run build locally:
npm run build
  • Run dev locally:
npm run dev

πŸ“Œ Notes

Version changes

File From To Type
.github/workflows/deploy.yml node-version: 20.x node-version: 24.14.0 πŸ”΄ Major
.github/workflows/check-node.yml matrix: [22, 24] matrix: [24.14.0] 🟑 Minor
  • No .noderc.json exists in this repo, so update-node-npm.yml can already update to the latest LTS without restrictions
  • Node 24 was tested locally and works correctly (npm install, npm run build and npm run dev)

πŸ”— References

Files to modify

  • .github/workflows/update-node-npm.yml
  • .github/workflows/deploy.yml
  • .github/workflows/check-node.yml

Related PRs

Metadata

Metadata

Labels

bugSomething isn't workingconfigurationProject setup and configuration filesgithub_actionsGitHub .github/ folder configuration

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions