Skip to content

Missing shebang in .cjs launcher scripts causes syntax error when executed directly #155

@biggersun

Description

@biggersun

Description

The .cjs launcher scripts in the scripts/ directory are missing the #!/usr/bin/env node shebang line. When these files are executed directly via shell alias (as set up by Claude Code's shell integration), the shell attempts to interpret them as bash scripts, resulting in syntax errors.

Error Message

scripts/claude_remote_launcher.cjs: line 1: syntax error near unexpected token `('
scripts/claude_remote_launcher.cjs: line 1: `const originalSetTimeout = global.setTimeout;'

Root Cause

The alias created by Claude Code's shell integration points directly to the .cjs file:

alias mcp-cli='/path/to/happy-coder/scripts/claude_remote_launcher.cjs --mcp-cli'

Without a shebang, the shell uses the default interpreter (bash) instead of Node.js.

Affected Files

  • scripts/claude_remote_launcher.cjs
  • scripts/claude_local_launcher.cjs

Suggested Fix

Add #!/usr/bin/env node as the first line of each launcher script:

#!/usr/bin/env node
// Intercept setTimeout for the Claude Code SDK
const originalSetTimeout = global.setTimeout;
// ...

Environment

  • OS: macOS
  • Node.js installed via Volta
  • happy-coder version: 0.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions