Skip to content

[macOS] "env: node: No such file or directory" error due to env -S flag in Claude Code shebang #94

@DashFlowTrading

Description

@DashFlowTrading
## Bug Description
Claudia fails to launch Claude Code sessions on macOS with error "env: node: No such file or directory"

## Environment
- **OS**: macOS (ARM64)
- **Claudia Version**: Latest (built from source)
- **Node Version**: v18.20.8 (via Homebrew)
- **Claude Code Version**: 1.0.40

## Root Cause
The issue is caused by the shebang in Claude Code script:
```bash
#!/usr/bin/env -S node --no-warnings --enable-source-maps

The -S flag in /usr/bin/env is not properly supported in the execution context that Claudia uses on macOS.

Reproduction Steps

  1. Install Claude Code via npm: npm install -g @anthropic-ai/claude-code
  2. Launch Claudia
  3. Create/open a CC Project
  4. Try to start a Claude Code session
  5. Error appears: "env: node: No such file or directory"

Expected Behavior

Claude Code should launch successfully

Workaround Found

Modifying the shebang in the Claude Code script from:

#!/usr/bin/env -S node --no-warnings --enable-source-maps

to:

#!/usr/bin/env node

Resolves the issue completely.

Suggested Fix

Claudia could either:

  1. Pre-process the Claude Code script to remove the -S flag before execution
  2. Use a different execution method that handles the -S flag properly on macOS
  3. Document this known issue and workaround in the troubleshooting guide

Additional Context

  • node --version works fine in terminal
  • /usr/bin/env node --version works fine
  • /usr/bin/env -S node --version may fail depending on macOS setup
  • Issue persists across reboots and is only resolved by shebang modification
  • Setting PATH environment variables in Claudia Settings does not resolve the issue
  • This appears to be specific to how macOS handles the -S flag in subprocess execution contexts

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