[BUG] claude crashes when wanting sudo after start
Environment
- Platform (select one):
- [X ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other:
- Claude CLI version: <!-- output of
claude --version--> 0.2.66 - Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 --> Arch
- Terminal: <!-- e.g. iTerm2, Terminal App --> kitty, running a fish shell
Bug Description
Whenever i start claude, it tries sudo and crashes as no password is given.
` ╰─λ claude
╭──────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code research preview! │
│ │
│ /help for help │
│ │
│ cwd: /home/XXX/Project │
╰──────────────────────────────────────────────────╯
Tips for getting started:
- Run /init to create a CLAUDE.md file with instructions for Claude
- Use Claude to help with file analysis, editing, bash commands and git
- Be as specific as you would with another engineer for the best results
╭─────────────────────────────────────────────────────────────────────────────────────────────╮
│ > Try "fix lint errors" │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯
? for shortcuts
[sudo] password for XXX: Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:159:15)
at writeGeneric (node:internal/stream_base_commons:150:3)
at Socket._writeGeneric (node:net:971:11)
at Socket._write (node:net:983:8)
at writeOrBuffer (node:internal/streams/writable:570:12)
at _write (node:internal/streams/writable:499:10)
at Writable.write (node:internal/streams/writable:508:10)
at N6.sendToShell (file:///home/XXX/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:501:766)
at file:///home/XXX/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:501:473
at new Promise (<anonymous>) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
}
Total cost: $0.0000
Total duration (API): 0s
Total duration (wall): 2.7s
Total code changes: 0 lines added, 0 lines removed`
Steps to Reproduce
- Just run claude
Expected Behavior
Well, not to crash of course and not to need sudo
Actual Behavior
Additional Context
Installation worked fine. Like adviced on the website I did the installation without sudo, but into a local ~/.npm-global directory.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗