claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Installation creates FreeBSD-incompatible shebang in wrapper script

Open hagan opened this issue 1 year ago • 3 comments

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When installing claude-code via npm update on FreeBSD, the wrapper script at ~/.claude/local/claude is created with #!/bin/bash, which doesn't exist on FreeBSD (bash is at /usr/local/bin/bash).

Expected: Use #!/usr/bin/env bash for cross-platform compatibility Actual: Hardcoded #!/bin/bash Version: 2.0.10 OS: FreeBSD 14.3

This breaks claude after running npm update @anthropic-ai/claude-code as recommended by claude doctor.

What Should Happen?

Expect claude to load, instead get bad interpreter: /bin/bash: no such file or directory

Error Messages/Logs

zsh: /home/username/.claude/local/claude: bad interpreter: /bin/bash: no such file or directory

Steps to Reproduce

Just running claude on a FreeBSD system, probably of any release. Scripts assumed location is incorrect

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.10 (Claude Code)

Platform

Anthropic API

Operating System

Other

Terminal/Shell

Terminal.app (macOS)

Additional Information

Changing the shell path to /usr/local/bin/bash fixes it

hagan avatar Oct 08 '25 00:10 hagan

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 07 '25 10:12 github-actions[bot]

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] avatar Jan 07 '26 10:01 github-actions[bot]

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Jan 14 '26 14:01 github-actions[bot]