claude-code
claude-code copied to clipboard
[BUG] Bash tool: npm commands fail with silent Exit code 1 (works in shell, fails only in Claude Code)
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 I run a simple npm command inside Claude Code, the task fails immediately with:
Error: Exit code 1
What Should Happen?
The command should 0:
$ npm run lint
> [email protected] lint
> npx eslint . --ext .ts
$ echo $?
0
Error Messages/Logs
Claude doesn't show anything in the detailed logs that could let me infer why it interprets Exit Code 1
Steps to Reproduce
npm installed via snap
10.9.4
"scripts": {
"lint": "npx eslint . --ext .ts",
},
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.0.55 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
No response