Skip to content

Fix npm install breaking on Node versions other than 22.0.0#207

Merged
khaliqgant merged 42 commits into
mainfrom
claude/fix-issue-204-uNZ6y
Jan 21, 2026
Merged

Fix npm install breaking on Node versions other than 22.0.0#207
khaliqgant merged 42 commits into
mainfrom
claude/fix-issue-204-uNZ6y

Conversation

@khaliqgant

Copy link
Copy Markdown
Member

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

@my-senior-dev-pr-review

my-senior-dev-pr-review Bot commented Jan 17, 2026

Copy link
Copy Markdown

🤖 My Senior Dev — Analysis Complete

👤 For @khaliqgant

📁 Expert in .trajectories/ (18 edits) • ⚡ 108th PR this month

View your contributor analytics →


📊 83 files reviewed • 47 need attention

⚠️ Needs Attention:

  • .github/workflows/node-compat.yml — New workflow for Node.js compatibility testing needs a thorough validation of critical path coverage.
  • deploy/workspace/Dockerfile — Essential for production deployment; changes could affect container security and performance.
  • +4 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.

@khaliqgant khaliqgant force-pushed the claude/fix-issue-204-uNZ6y branch from 43875b6 to 48758f1 Compare January 17, 2026 13:03
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.
@khaliqgant khaliqgant force-pushed the claude/fix-issue-204-uNZ6y branch from 3baa1b0 to 093c42f Compare January 18, 2026 18:53
claude and others added 13 commits January 18, 2026 19:04
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>
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>
@khaliqgant khaliqgant force-pushed the claude/fix-issue-204-uNZ6y branch from 89edb94 to 51ae0e4 Compare January 19, 2026 09:45
The check for 'waitUntilCliReady' in pty is sufficient to determine if we
can call the async method. The useRelayPty variable doesn't exist and was
likely left over from incomplete refactoring.

This resolves the TS2304 compilation error on line 642.
khaliqgant and others added 18 commits January 19, 2026 12:55
… claude/fix-issue-204-uNZ6y

Resolve package-lock.json conflict by accepting remote and regenerating.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Regenerate package-lock.json with proper resolved/integrity fields for
  cross-platform optional dependencies (fixes rollup-linux-x64-gnu missing
  on CI)
- Fix all req.params destructuring in Express route handlers to use
  explicit string casts, as Express 5 types params as `string | string[]`

Affected files:
- admin.ts, billing.ts, codex-auth-helper.ts, consensus.ts, coordinators.ts
- daemons.ts, generic-webhooks.ts, github-app.ts, monitoring.ts, nango-auth.ts
- onboarding.ts, policy.ts, providers.ts, repos.ts, teams.ts, test-helpers.ts
- workspaces.ts, server.ts

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add proper localStorage mock to Sidebar.archive.test.tsx to match the
main Sidebar.test.tsx file. The test was failing because localStorage.clear()
wasn't a function in the test environment.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Conflicts resolved:
- src/cloud/api/providers.ts: Used main's variable rename (providerParam)
- src/wrapper/pty-wrapper.ts: Kept deletion (file removed intentionally)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…rsion

Fix: Update Docker Rust to 1.83 for Cargo.lock v4 support
Resolved conflict in src/cloud/server.ts GET /api/channels/:channel/members
endpoint - kept the complete implementation from main that queries the
database for channel members with fallback to dashboard proxy.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Cursor agent support: CLI type detection, auth config, spawn modal,
  Docker install, cloud provider registry
- Fix connection storm bug: UserBridge now exposes getRelayClient() to
  prevent duplicate relay clients for same username
- Consolidate provider connection UI: Created shared ProviderConnectionList
  component used by both /app and /providers pages
- Add relay-pty build stage to Dockerfile.local for local development
- Remove remaining node-pty references (relay-pty is now the standard)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add --yolo flag to Gemini agents in spawner for auto-accept prompts
- Add prompt handlers for Gemini API key confirmation and terms acceptance
- Add Gemini to AI_PROVIDERS list in both onboarding pages
- Pass workspaceId to mark-connected endpoint in TerminalProviderSetup

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Gemini CLI shows an interactive menu where users can choose:
- Login with Google (OAuth)
- Enter Gemini API key

Using terminal-based setup in both onboarding and workspace settings
gives users the flexibility to choose their preferred auth method.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Conflict resolutions:
- .trajectories/index.json: Kept all trajectories from both branches
- src/cloud/server.ts: Used workspace.publicUrl routing for channel messages
  (per cloud-websocket-routing rule)

Additional fix:
- scripts/test-cli-auth/Dockerfile.real: Update Rust from 1.75 to 1.82
  (Cargo.lock v4 requires Rust 1.78+)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Express query params can be string | string[] - use proper type
narrowing instead of unsafe casts to fix TS2345 error.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Without this mapping, when 'google' was passed as the CLI
from TerminalProviderSetup, it wasn't being mapped to 'gemini',
so the --yolo flag was never applied.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused imports (afterEach, vi, beforeEach, path, DeadLetter,
  PoolClient, ChannelJoinPayload, ChannelLeavePayload, RelayPtyOrchestratorConfig)
- Prefix unused variables with underscore (displayName, channel, member,
  workspaceId, messages, errorMessage, channelId, upToMessageId, joinChannel,
  result, content, id, err)
- Add eslint-disable comment for prefer-const on forward declaration
- Change catch(err: any) to catch(_err: unknown) for type safety

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Gemini's interactive terminal allows users to choose between:
- Login with Google (OAuth)
- Use Gemini API Key

Removing the separate API key input form simplifies the UX.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit 4e3bb19 into main Jan 21, 2026
19 checks passed
@khaliqgant khaliqgant deleted the claude/fix-issue-204-uNZ6y branch January 21, 2026 11:55
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