[BUG] npm/node commands (npx vite build, npm install) hang indefinitely in the Bash tool

Resolved 💬 6 comments Opened Feb 20, 2026 by cezgit Closed Apr 16, 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?

Commands complete in ~2s in the terminal but never return in Claude Code
CI=true, --no-color, 2>&1, and run_in_background all fail the same way
macOS Darwin 25.3.0, Node/npm via Vite 6
See attached screenshot

<img width="1114" height="476" alt="Image" src="https://github.com/user-attachments/assets/31798095-1659-4bfb-bc3b-4f2a08e32e03" />

What Should Happen?

The Bash tool should return the command output within a few seconds of the command completing. For a npx vite build that finishes in ~1.7s, the tool result should be available in under 5s. Instead, the tool hangs indefinitely — even with run_in_background: true, the output never becomes readable via TaskOutput despite the underlying process completing almost instantly.

Error Messages/Logs

Steps to Reproduce

  1. In any project with a package.json and Node.js dependencies installed, run any npm/node command via the Bash tool:

Bash(cd /path/to/project && npx vite build 2>&1)

  1. The command completes in ~2s in a normal terminal, but the Bash tool never returns the output
  2. Tried variations — all hang the same way:
  • CI=true npx vite build 2>&1
  • npx vite build --no-color 2>&1
  • npm install 2>&1
  • Using run_in_background: true + TaskOutput to read results
  1. Non-node commands (e.g., mvn clean install) work fine through the Bash tool in the same session

Environment:

  • macOS Darwin 25.3.0
  • Claude Code with Opus 4.6
  • Node.js v25.4.0
  • Vite 6.4.1
  • Terminal App: Ghostty 1.2.3

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.49 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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