npm / npm/cli

[BUG] `npx x | y`, when `x` has an install prompt, hangs forever

Open
#3,781 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug cmd:exec Priority 2 Release 10.x Release 7.x Release 8.x Release 9.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

Run npx x | y, for any x where you'd get an install prompt, and any y that receives piped input - echo should be fine.

It will hang forever.

Expected Behavior

It should detect that it's in a pipe, and auto-fail rather than prompting the user for something they can't ever respond to.

Steps To Reproduce

See above.

Environment
  • OS: Mac
  • Node: 16
  • npm: 7.latest

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by running the reported npx x | y reproduction with an install prompt and trace the npx prompt-handling entry point; done means the command detects piped input and fails instead of waiting for an interactive response.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.