Skip to content

[BUG] npm pkg get does not return result when only one of multiple arguments exist in the package.json #7854

@Sanderovich

Description

@Sanderovich

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

Given the following package.json

{ "name": "package" }

When you run npm pkg get name dependencies peerDependencies,
Then you get no result.

Expected Behavior

Given the following package.json

{ "name": "package" }

When you run npm pkg get name dependencies peerDependencies,
Then we get the following result

{ "name": "package" }

Steps To Reproduce

  1. With the following config
{ "name": "package" }
  1. Run npm pkg get name dependencies peerDependencies

Environment

  • npm: 10.9.0
  • Node.js: 20.16.0
  • OS Name: Ubuntu 22.04.5 LTS

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