-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issueconfig:displayIssues dealing with display of data to terminalIssues dealing with display of data to terminal
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
As of 7.20.0
, querying the versions
field with the --json
flag (npm view $package versions --json
) for a package with only one published version will return a single string value, which is not parseable as JSON.
Expected Behavior
In versions prior to 7.20.0
, querying the versions
field with the --json
flag (npm view $package versions --json
) for a package with only one published version would return an array with a single string, which is parseable as JSON.
Steps To Reproduce
- Using npm
7.20.X
, runnpm view $package versions --json
for a package with only one published version.- For example:
npm view @types/spdx-satisfies versions --json
- For example:
- Note that the stdout response contains a single string, rather than an array.
For comparison:
- Using npm
7.19.X
, runnpm view $package versions --json
for a package with only one published version.- For example:
npm view @types/spdx-satisfies versions --json
- For example:
- Note that the stdout response is valid JSON: a single string wrapped in an array.
Environment
- OS: macOS 11.4
- Node: 14.17.0
- npm: 7.20.1
msimerson
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issueconfig:displayIssues dealing with display of data to terminalIssues dealing with display of data to terminal