Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
bdkjones opened this issue Jun 15, 2023 · 0 comments · Fixed by #8234
Closed
2 tasks done

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

bdkjones opened this issue Jun 15, 2023 · 0 comments · Fixed by #8234
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 9.x work is associated with a specific npm 9 release

Comments

@bdkjones
Copy link

bdkjones commented Jun 15, 2023

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
@bdkjones bdkjones added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Jun 15, 2023
@lukekarrys lukekarrys added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels Jun 15, 2023
@lukekarrys lukekarrys self-assigned this Jun 15, 2023
@lukekarrys lukekarrys removed their assignment Feb 25, 2025
@wraithgar wraithgar self-assigned this Apr 17, 2025
wraithgar added a commit that referenced this issue Apr 17, 2025
This was removed in npm 7 and never got re-added.  In order for this not to be a breaking change the info was added to new fields, since the old fields are already being used to return counts.

This differs slightly from the npm 6 output, as "changed" now has a "from" and "to" field instead of a tacked on "previousVersion" field.

Closes: #6558
wraithgar added a commit that referenced this issue Apr 17, 2025
This was removed in npm 7 and never got re-added.  In order for this not to be a breaking change the info was added to new fields, since the old fields are already being used to return counts.

This differs slightly from the npm 6 output, as "changed" now has a "from" and "to" field instead of a tacked on "previousVersion" field.

Closes: #6558
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants