Skip to content

[BUG] npm-pack --json emits prepare script commands, making json invalid #7354

@miiihi

Description

@miiihi

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

npm pack --json in the latest npm version (10.5.0) emits prepare script commands and thus making the output invalid json.
This is a breaking change from previous npm version, which broke our deploy workflows.

image

Expected Behavior

npm pack --json should always output valid json, as it was in the previous versions.

image

Steps To Reproduce

Create a package which includes a prepare script.
Run npm pack --json

Environment

  • npm:
  • Node.js:
  • OS Name:
  • System Model Name:
  • npm config:
; copy and paste output from `npm config ls` here

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions