Skip to content

[DOCS] npm cli help does not fit the real npm behavior #7402

@Z9n2JktHlZDmlhSvqc9X2MmL3BwQG7tk

Description

Is there an existing issue for this?

  • I have searched the existing issues

This is a CLI Docs Problem, not another kind of Docs Problem.

  • This is a CLI Docs Problem.

Description of Problem

# npm search --help
Search for packages

Usage:
npm search [search terms ...]

Options:
[-l|--long] [--json] [--color|--no-color|--color always] [-p|--parseable]
[--no-description] [--searchopts <searchopts>] [--searchexclude <searchexclude>]
[--registry <registry>] [--prefer-online] [--prefer-offline] [--offline]

aliases: find, s, se

Run "npm help search" for more info

As you can see all parameters are in square brackets, so they are optional.
Doing search:

# npm search --registry=https://my.local.registry
npm ERR! search must be called with arguments

??? With what arguments ? Help does not show any arguments requirement.
Trying another help (as stated by npm itself - Run "npm help search" for more info):

# npm help search
npm ERR! help process exited with code: ENOENT

WTF ??? Where is normal help ?

Versions:
npm-9.8.1
nodejs-18.18.2

Potential Solution

No response

Affected URL

No response

Metadata

Metadata

Assignees

Labels

Documentationdocumentation related issueGood First Issuegood issue or PR for newcomersPriority 2secondary priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions