Skip to content

[BUG] npm approve-scripts --json output issues #9529

Description

@naugtur

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

This is not just a request to bump a dependency for a CVE

  • This is not solely a request to bump a dependency for a CVE

Current Behavior

in some configurations npm prints text instead of JSON to stdout:

  • --allow-scripts-pending
$ npm approve-scripts --allow-scripts-pending --json
2 packages have install scripts not yet covered by allowScripts:
  @lavamoat/preinstall-always-fail@1.0.3 (install: (install scripts present))
  not-really-a-package@1.1.0 (install: (install scripts present))

Run `npm approve-scripts <pkg>` to allow, or `npm deny-scripts <pkg>` to deny.
  • when allowScripts is already populated
$ npm approve-scripts --all --allow-scripts-pin --json
No packages with unreviewed install scripts.

Expected Behavior

produces JSON like npm approve-scripts --all --json but with "change": "pending" for pending changes and { "allowScripts": [] } for empty result

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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