Skip to content

[BUG] npm info exits with zero exit code if package@version is not found #4964

Closed
@ThisIsMissEm

Description

@ThisIsMissEm

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

If I do:

npm info [email protected] && echo $?

Then the exit code is 0, but no output from npm info is printed, as 8.7.1 of npm doesn't exist. I would expect npm info to give a non-zero exit code if the package at the specified version doesn't exist. If the package doesn't exist at all, then npm info does have a non-zero exit code (with logs telling you it doesn't exist)

Expected Behavior

Would log a message saying the specified version of that package doesn't exist, and exit with a non-zero exit code, much like for non-existent packages.

Steps To Reproduce

See above, assuming [email protected] hasn't been published in the meantime.

Environment

  • npm: 8.7.1
  • Node.js: v16.13.1
  • OS Name: MacOS latest
  • System Model Name:
  • npm config: no non-default configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2secondary priority issueRelease 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