[BUG] npm view $package versions --json
returns non-JSON string for packages with only one version
#3611
Labels
Bug
thing that needs fixing
Priority 2
secondary priority issue
Release 7.x
work is associated with a specific npm 7 release
Is there an existing issue for this?
Current Behavior
As of
7.20.0
, querying theversions
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 theversions
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
7.20.X
, runnpm view $package versions --json
for a package with only one published version.npm view @types/spdx-satisfies versions --json
For comparison:
7.19.X
, runnpm view $package versions --json
for a package with only one published version.npm view @types/spdx-satisfies versions --json
Environment
The text was updated successfully, but these errors were encountered: