Skip to content

[BUG?] npm pack --json removed from npm v6 to v7?Β #2038

Closed
@legodude17

Description

@legodude17

Current Behavior:

npm pack --json will completely ignore the --json option and output it's usual stuff anyway:

❯ npm pack --json
npm notice
npm notice πŸ“¦  go-out@0.3.4
npm notice === Tarball Contents ===
npm notice 541B  .eslintrc
npm notice 3.1kB index.js
npm notice 742B  package.json
npm notice 44B   readme.md
npm notice === Tarball Details ===
npm notice name:          go-out
npm notice version:       0.3.4
npm notice filename:      go-out-0.3.4.tgz
npm notice package size:  1.8 kB
npm notice unpacked size: 4.4 kB
npm notice shasum:        335e6a29ea9d42ba2d3817f85529936124e89258
npm notice integrity:     sha512-CAsUMo/cw4Aky[...]sDbM8gk8vr51A==
npm notice total files:   4
npm notice
go-out-0.3.4.tgz

Expected Behavior:

npm pack --json on npm v6 and earlier would output a json description of the tarball, which I believe was virtually identical to the output of getContents in lib/utils/tar.js.

Steps To Reproduce:

  1. Using npm v7
  2. Run npm pack --json

Environment:

  • OS: macOS Catalina 10.15.7
  • Node: 15.0.1
  • npm: 7.0.3

Additional Notes

My use case was to find what would be included in a tarball, so I'm going to use npm-packlist now, but this change did break one of my tools (go-out) and I could not find any documentation about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2secondary priority issueRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions