Skip to content

[REGRESSION] Restore Complete JSON Output from 6.x #6558

@bdkjones

Description

@bdkjones

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

Consider this command: npm install bootstrap --json

The output using npm 7.x, 8.x, or 9.x is this:

{
  "added": 2,
  "removed": 0,
  "changed": 0,
  "audited": 0,
  "funding": 2
}

Expected Behavior

The output of that same command run with npm 6.x is this:

{
  "added": [
    {
      "action": "add",
      "name": "boostrap",
      "version": "2.0.0",
      "path": "/Users/bdkjones/Desktop/untitled folder/node_modules/boostrap"
    }
  ],
  "removed": [],
  "updated": [],
  "moved": [],
  "failed": [],
  "warnings": [],
  "audit": {
    "actions": [],
    "advisories": {},
    "muted": [],
    "metadata": {
      "vulnerabilities": {
        "info": 0,
        "low": 0,
        "moderate": 0,
        "high": 0,
        "critical": 0
      },
      "dependencies": 1,
      "devDependencies": 0,
      "optionalDependencies": 0,
      "totalDependencies": 1
    }
  },
  "funding": "",
  "elapsed": 618
}

THIS output is insanely more useful for integrating npm into other tooling and build systems. The truncated output from versions 7, 8, and 9 is not useful. This regression has existed for years now and it would be great if npm could finally address it. Competing package managers (yarn) don't have this issue.

Steps To Reproduce

  1. Run npm install [somePackage] --json with npm 6.x and compare the output to that of any later major release.
  2. Note that the addition of --verbose (or any other logging level) does not change the JSON output. (That would, optionally, be a nice feature.)

Environment

  • npm: 9.7.1
  • Node.js: 18.15.0
  • OS Name: macOS
  • System Model Name: MacBook Pro M2 Max
  • npm config: N/A

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 9.xwork is associated with a specific npm 9 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions