Skip to content

fix: Node 25 native dependency compatibility (#204)#229

Closed
khaliqgant wants to merge 12 commits into
mainfrom
fix/node-25-compat
Closed

fix: Node 25 native dependency compatibility (#204)#229
khaliqgant wants to merge 12 commits into
mainfrom
fix/node-25-compat

Conversation

@khaliqgant

Copy link
Copy Markdown
Member

Summary

Upgrade native dependencies to support Node 25 compatibility by fixing V8 API breaking changes.

Changes

  • better-sqlite3: 9.4.3 → 12.6.2

    • Resolves V8 API breaking changes introduced in Node 25
    • Version 12.6.2 explicitly supports Node 20-25 (per engines in package.json)
  • esbuild: 0.24.0 → 0.27.2

    • Includes Node 25 prebuild binaries
    • Ensures native module compilation works on Node 25
  • package-lock.json: Regenerated via npm install

    • Postinstall rebuild succeeded
    • All transitive dependencies resolved

Testing

  • npm install + postinstall rebuild completed successfully
  • ⚠️ Node 22/25 build verification needed (environment has Node 20.20.0 only)
  • Recommend: Verify with npm install && npm run build on Node 22 and Node 25 CI environments

Related Issues

Resolves #204 - Node 25 compatibility issues

Breaking Changes

None - backward compatible with Node 20-22

claude and others added 12 commits January 19, 2026 09:43
Change .nvmrc from exact version v22.0.0 to major version 22, allowing
any 22.x.x version to be used. This fixes compatibility issues for users
running different minor/patch versions of Node 22.

Fixes #204
- Remove node-pty from package.json dependencies
- Update spawner.ts to require relay-pty binary (no fallback)
- Simplify AgentWrapper type to only use RelayPtyOrchestrator

This improves Node.js version compatibility by removing the native
node-pty module that requires compilation for each Node version.
The relay-pty Rust binary provides PTY functionality instead.

Related to #204
BREAKING: Removes node-pty native module dependency and migrates all
PTY functionality to use the relay-pty Rust binary.

Changes:
- Remove node-pty from package.json dependencies
- Update spawner.ts to require relay-pty binary (no fallback)
- Migrate cli-pty-runner.ts to use relay-pty via child_process.spawn
- Migrate cli-auth.ts to use relay-pty for auth flows
- Update onboarding.ts to remove IPty type dependency
- Create wrapper-types.ts for shared event type definitions
- Update imports in agent-manager.ts, persistence.ts to use wrapper-types.ts

This improves Node.js version compatibility (including Node 25) by
eliminating native module compilation requirements. The relay-pty Rust
binary provides equivalent PTY functionality without version constraints.

The relay-pty binary must be available for:
- Agent spawning via Spawner
- CLI authentication flows
- CLI PTY runner operations

Fixes #204
Add GitHub Actions workflow that tests npm install across multiple
Node.js versions (18, 20, 22, 24, 25) using Docker containers.

Tests include:
- Full install and build in official Node images
- npm pack and global installation (npm install -g)
- ESM import verification
- Minimal install in slim images (no build tools)

This ensures the package installs correctly after removing the
node-pty native module dependency.

Related to #204
Replace references to node-pty with relay-pty in:
- spawner.ts file header and spawn method doc
- spawner.test.ts file header
The PtyWrapper class is no longer used after migrating to
RelayPtyOrchestrator. Remove the file to fix TypeScript
compilation errors from the missing node-pty dependency.

Event types have been moved to wrapper-types.ts.
- Use local import (./dist/index.js) instead of global package import
- Add npm test to verify functionality after build
- Remove problematic global install test
- Add fresh install test (deletes package-lock.json first)
- Verify native modules compile correctly
Update test scripts in scripts/test-cli-auth/ to use relay-pty
binary instead of node-pty:

- ci-test-runner.ts: Migrated to child_process.spawn with relay-pty
- test-oauth-flow.ts: Migrated to child_process.spawn with relay-pty
- package.json: Removed node-pty dependency

This completes the removal of node-pty from the entire codebase.
Remove scripts/test-pty-input.js and scripts/test-pty-input-auto.js
which were manual debugging scripts that used node-pty. These are not
part of the test suite and would fail without node-pty.
Add multi-stage Docker build that compiles relay-pty from source:
- Stage 1: Build relay-pty using rust:1.75-slim
- Stage 2: Copy binary to runtime image

This fixes the CLI OAuth tests which now depend on relay-pty
instead of node-pty for PTY emulation.
Add overrides for react and react-dom to resolve peer dependency conflict.
drizzle-orm@0.45.1 has optional peer dependencies on React Native packages
(expo-sqlite, @op-engineering/op-sqlite) that require React 19, but this
web project uses React 18.3.1. The overrides tell npm to use React 18
regardless of what the optional React Native packages want.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@my-senior-dev-pr-review

Copy link
Copy Markdown

🤖 My Senior Dev — Analysis Complete

👤 For @khaliqgant

📁 Expert in src/bridge/ (13 edits) • ⚡ 85th PR this month

View your contributor analytics →


📊 20 files reviewed • 12 need attention

⚠️ Needs Attention:

  • .github/workflows/node-compat.yml — Introduces a new GitHub Actions workflow for compatibility testing.
  • package-lock.json — Changes due to dependency updates could lead to installation inconsistencies.
  • +7 more concerns...

🚀 Open Interactive Review →

The full interface unlocks features not available in GitHub:

  • 💬 AI Chat — Ask questions on any file, get context-aware answers
  • 🔍 Smart Hovers — See symbol definitions and usage without leaving the diff
  • 📚 Code Archeology — Understand how files evolved over time (/archeology)
  • 🎯 Learning Insights — See how this PR compares to similar changes

💬 Chat here: @my-senior-dev explain this change — or try @chaos-monkey @security-auditor @optimizer @skeptic @junior-dev

📖 View all 12 personas & slash commands

You can interact with me by mentioning @my-senior-dev in any comment:

In PR comments or on any line of code:

  • Ask questions about the code or PR
  • Request explanations of specific changes
  • Get suggestions for improvements

Slash commands:

  • /help — Show all available commands
  • /archeology — See the history and evolution of changed files
  • /profile — Performance analysis and suggestions
  • /expertise — Find who knows this code best
  • /personas — List all available AI personas

AI Personas (mention to get their perspective):

Persona Focus
@chaos-monkey 🐵 Edge cases & failure scenarios
@skeptic 🤨 Challenge assumptions
@optimizer Performance & efficiency
@security-auditor 🔒 Security vulnerabilities
@accessibility-advocate Inclusive design
@junior-dev 🌱 Simple explanations
@tech-debt-collector 💳 Code quality & shortcuts
@ux-champion 🎨 User experience
@devops-engineer 🚀 Deployment & scaling
@documentation-nazi 📚 Documentation gaps
@legacy-whisperer 🏛️ Working with existing code
@test-driven-purist Testing & TDD

For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews.

Copy link
Copy Markdown
Member Author

Consolidated into PR #207 - all Node compatibility fixes now in single PR

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.

npm install breaks on versions other than 22.0.0

2 participants