Skip to content

fix: override yargs to v18 for Node 25 compatibility#391

Merged
TomerFi merged 2 commits intomasterfrom
fix/yargs-override-node25
Feb 28, 2026
Merged

fix: override yargs to v18 for Node 25 compatibility#391
TomerFi merged 2 commits intomasterfrom
fix/yargs-override-node25

Conversation

@TomerFi
Copy link
Copy Markdown
Owner

@TomerFi TomerFi commented Feb 28, 2026

Summary

  • Adds npm overrides to pin yargs to ^18.0.0 within c8, fixing the CJS/ESM interop crash on Node 25
  • Restores node: latest to the test matrix (alongside 20 and 22)

Context

c8 depends on yargs@^17 which uses require() in an extensionless file. Node 25 treats this as ESM in "type": "module" projects, causing ReferenceError: require is not defined. yargs 18 is ESM-first and resolves this.

Upstream fix in progress: bcoe/c8#578. The override can be removed once c8 releases with yargs 18.

Summary by CodeRabbit

  • Chores
    • Updated CI test matrix to use the latest Node.js release, broadening test coverage across supported environments.
    • Adjusted dependency resolution to pin a transitive package version, improving build stability and compatibility without changing runtime behavior.
    • No changes to public APIs or exported declarations.

@auto-me-bot auto-me-bot bot added the status: needs review Pull request needs a review label Feb 28, 2026
@snyk-io
Copy link
Copy Markdown

snyk-io bot commented Feb 28, 2026

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

Status Scanner Critical High Medium Low Total (0)
Open Source Security 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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 28, 2026

Warning

Rate limit exceeded

@TomerFi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 35 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between cf0297a and eb107b1.

📒 Files selected for processing (1)
  • package.json
📝 Walkthrough

Walkthrough

Replaced Node '24' with 'latest' in the GitHub Actions test matrix and added a top-level overrides in package.json to pin c8's transitive yargs dependency to ^18.0.0.

Changes

Cohort / File(s) Summary
CI/CD Workflow
​.github/workflows/test_package.yml
Replaced Node version '24' with 'latest' in the test matrix.
Dependency Resolution
package.json
Added top-level overrides to force c8yargs resolution to ^18.0.0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🔄 CI now runs on latest, tests in flight,
A tiny override keeps yargs polite,
c8 behaves, transitive lines align,
Quick green checks and semver all fine ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a yargs override for Node 25 compatibility. It reflects the primary objective and matches the substantive changes in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/yargs-override-node25

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.97%. Comparing base (e828686) to head (eb107b1).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #391   +/-   ##
=======================================
  Coverage   46.97%   46.97%           
=======================================
  Files           3        3           
  Lines         149      149           
=======================================
  Hits           70       70           
  Misses         79       79           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

c8 depends on yargs ^17 which breaks on Node 25 due to CJS/ESM
interop changes. Override yargs to ^18 (ESM-first) until c8
updates its dependency (bcoe/c8#578).

Also restores node latest to the test matrix alongside 20 and 22.

Signed-off-by: Tomer Figenblat <tomer@figenblat.com>
@TomerFi TomerFi force-pushed the fix/yargs-override-node25 branch from ed8c560 to cf0297a Compare February 28, 2026 00:06
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Around line 58-62: The package.json "overrides" entry currently forces "c8" to
use "yargs": "^18.0.0", but yargs@18 requires Node >=20.19.0 which breaks the
project’s declared Node floor (>=18.0.0); update package.json to either (A)
raise the package's "engines.node" minimum to ">=20.19.0" to match yargs@18, (B)
relax the override to target a Node-18-compatible version such as "yargs": "^17"
(or remove the override entirely) so Node 18 users can install, or (C)
remove/adjust the "overrides" block for "c8" to avoid pinning yargs@18; modify
the "overrides" -> "c8" -> "yargs" entry accordingly and ensure the lockfile is
regenerated.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed8c560 and cf0297a.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • .github/workflows/test_package.yml
  • package.json

@auto-me-bot auto-me-bot bot added status: review started Pull review in progress and removed status: needs review Pull request needs a review labels Feb 28, 2026
yargs 18 requires Node >= 20.19.0. Node 18 is EOL since April 2025.

Signed-off-by: Tomer Figenblat <tomer@figenblat.com>
@TomerFi TomerFi merged commit 4d1cd95 into master Feb 28, 2026
17 checks passed
@TomerFi TomerFi deleted the fix/yargs-override-node25 branch February 28, 2026 00:20
@auto-me-bot auto-me-bot bot added status: merged Pull request merged and removed status: review started Pull review in progress labels Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: merged Pull request merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant