Skip to content

[BUG] npm pack in 10.5.0 introduces breaking change due to changed output  #7561

@falsyvalues

Description

@falsyvalues

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Prior to v10.5.0 there was possibility to directly redirect npm pack output to file and retrieve tarball file name for given package. Starting from 10.5.0 and above stdout is being polluted by prepare scripts output and command itself.

> [email protected] prepare
> echo "Should not be visible"
[email protected]

Expected Behavior

npm pack should output to std only tarball file name as it was before otherwise its a breaking change.

Steps To Reproduce

  1. In any package add prepare script which writes to stdout
  2. Run npm pack and redirect stdout to file e.g. npm package > package-name
  3. Inspect package-name file content
  4. It should contain only package tarball name

Environment

  • npm: v10.8.0
  • Node.js: v20.13.1
  • OS Name: macOS 14.4.1
  • System Model Name: MacBook Pro

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions