Skip to content

[BUG] npm view/show result is empty if "latest" tag does not exist #4029

@AlexanderSamoilov

Description

@AlexanderSamoilov

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

npm view/show works only if there is a version tagged "latest". It was always like this.
I don't like this behavior. I want "npm view" return the list in any case, regardless of whether "latest" exists or not.
(see console logs below)

Expected Behavior

"npm view/show my_pkg versions" should return easily the version list in chronological order, regardless of what tags are.

Steps To Reproduce

This console log shows an example of package which has only "next" and "master" tags, but no "latest". For this package "npm show" returns empty output and zero return code.

$ npm dist-tag ls @my_scope/my_pkg
master: 1.2.20220100-DEVBUILD.8
next: 1.2.20211200-RC.2

$ npm show @my_scope/my_pkg versions
$ echo $?
0

Environment

  • npm: 8.1.3 (reproduced 7.x, 6.x, 3.x as well)
  • Node: 14.17.6 (reproduced with 12.x, 10.x as well)
  • OS: Linux (Ubuntu 18.04)
  • platform: x86_64
  • npm config:
not relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions