[BUG] Bash tool: npm commands fail with silent Exit code 1 (works in shell, fails only in Claude Code)

Resolved 💬 8 comments Opened Nov 27, 2025 by Wenzel Closed Feb 28, 2026

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

<img width="283" height="102" alt="Image" src="https://github.com/user-attachments/assets/5a0f03ce-6e9e-4331-a35d-4950e8aacac1" />

What Should Happen?

The command should 0:

~~~shell
$ npm run lint

test-graphql@1.0.0 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

~~~JSON
"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_

View original on GitHub ↗

This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗