Skip to content

chore: upgrade Node.js runtime from 20 to 22 LTS#6769

Open
danskmt wants to merge 1 commit intomainfrom
chore/CLI-1469-upgrade-node-22-e2e
Open

chore: upgrade Node.js runtime from 20 to 22 LTS#6769
danskmt wants to merge 1 commit intomainfrom
chore/CLI-1469-upgrade-node-22-e2e

Conversation

@danskmt
Copy link
Copy Markdown
Contributor

@danskmt danskmt commented May 5, 2026

Depends on #6764

What this does

Upgrades the Snyk CLI repository to Node.js 22 LTS (CLI-1469): engines.node^22, .nvmrc and CI defaults aligned on the chosen 22.x patch, dependency / lockfile updates as needed, and GitHub Actions + CircleCI config adjusted so Linux/Windows/macOS pipelines install and test against 22 (including native build / embedded CLI paths where applicable). Documentation is updated so supported Node versions match what we actually run in CI.

Why Node 22 and not Node 24 (for now)

  • Still LTS, smaller jump: 22 is a supported LTS line and is a deliberate step up from 20 without adopting the newest major immediately.
  • Avoid Node 24–specific test / stderr churn: On Node 24 we saw deprecation warnings on stderr (e.g. legacy url.parse, child_process + shell behaviour) from transitive dependencies. Many Jest acceptance tests assert stderr is empty, so those warnings fail CI unless we upgrade dependencies, change spawn behaviour, or filter stderr in tests. On 22, we expect to validate real behaviour without that layer of suppression.
  • Stabilize CI first: Land 22, get green pipelines and product confidence, then plan 24 with dependency upgrades and any intentional code changes, rather than coupling the version bump to test-harness workarounds.

Notes for the reviewer

  • Confirm CircleCI executor images, GitHub Actions node-version, .nvmrc, and engines are all consistent with the same 22.x line.
  • Confirm Windows install path (install-node.ps1 / NVM + MSI fallback) matches the pinned version and checksum where used.
  • If we narrow or change test matrices, confirm that matches intended support policy for the CLI.

More information

Screenshots

N/A

@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented May 5, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@danskmt danskmt force-pushed the chore/CLI-1469-upgrade-node-22-e2e branch 2 times, most recently from 7597e06 to 9f66721 Compare May 5, 2026 12:53
@danskmt danskmt changed the title chore: [Test Deprecated Warnings on Node 22] upgrade Node.js runtime from 18 to 22 LTS chore: upgrade Node.js runtime from 18 to 22 LTS May 5, 2026
@danskmt danskmt force-pushed the chore/CLI-1469-upgrade-node-22-e2e branch 4 times, most recently from cf42fb7 to 9da4cbb Compare May 6, 2026 07:50
@danskmt danskmt changed the title chore: upgrade Node.js runtime from 18 to 22 LTS chore: upgrade Node.js runtime from 20 to 22 LTS May 6, 2026
@danskmt danskmt force-pushed the chore/CLI-1469-upgrade-node-22-e2e branch 5 times, most recently from 44669b7 to d816e1b Compare May 8, 2026 12:49
@PeterSchafer PeterSchafer marked this pull request as ready for review May 8, 2026 14:33
@PeterSchafer PeterSchafer requested review from a team as code owners May 8, 2026 14:33
@snyk-pr-review-bot

This comment has been minimized.

@PeterSchafer PeterSchafer force-pushed the chore/CLI-1469-upgrade-node-22-e2e branch from d816e1b to 1ab8544 Compare May 8, 2026 14:41
@snyk-pr-review-bot

This comment has been minimized.

Comment thread .github/workflows/check-dependencies.yml Outdated
Comment thread .github/workflows/danger-zone.yml Outdated
@PeterSchafer PeterSchafer force-pushed the chore/CLI-1469-upgrade-node-22-e2e branch from 1ab8544 to 471a8e6 Compare May 8, 2026 17:00
@snyk-pr-review-bot
Copy link
Copy Markdown

PR Reviewer Guide 🔍

🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Smoke Test Matrix Mismatch 🟠 [major]

The smoke test matrix still includes Node 16, 18, and 20, but the PR makes changes that break compatibility with these versions. Specifically, package.json now requires Node ^22, and several core dependencies like snyk-gradle-plugin (v6.0.0) and snyk-nodejs-plugin (v2.0.0) have moved their minimum requirements to Node 20.19+ or 22+ (see package-lock.json). Running smoke tests on 16 or 18 will fail during npm install or execution.

node_version: [16, 18, 20, 22]
Unexplained Major Plugin Bumps 🟠 [major]

The PR includes major version bumps for core scanning plugins: snyk-gradle-plugin (5.1.1 to 6.0.0) and snyk-nodejs-plugin (1.6.3 to 2.0.0). These are critical modules for the CLI's scanning logic. While necessary for Node 22 support, these major versions likely contain breaking changes in manifest parsing or dependency resolution that are not mentioned in the PR description, posing a significant operational risk to the scanner's stability.

"snyk-gradle-plugin": "6.0.0",
"snyk-module": "3.1.0",
"snyk-mvn-plugin": "^4.7.0",
"snyk-nodejs-lockfile-parser": "2.7.1",
"snyk-nodejs-plugin": "^2.0.0",
Restrictive Node Engine 🟡 [minor]

Setting engines.node to ^22 is overly restrictive for a CLI tool. It prevents the package from being installed on Node 20 (which is still a supported LTS) and will block installation on future major versions like Node 23 or 24. Standard practice for Node LTS upgrades is to use a range like >=22 or ^20 || ^22 to maintain compatibility with existing LTS environments while targeting the new version.

"node": "^22"
📚 Repository Context Analyzed

This review considered 27 relevant code sections from 1 files (average relevance: 0.88)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants