Skip to content

[BUG] npm suggests installing/publishing the help package; help publish is broken #2854

Closed
@lf-

Description

@lf-

Current Behavior:

Running npm publish --help tells you to run npm publish help:

» npm publish --help
npm publish

Usage:
npm publish [<folder>] [--tag <tag>] [--access <public|restricted>] [--dry-run]

Run "npm publish help" for more info

Doing that gets:

» npm publish help 
npm notice 
npm notice 📦  [email protected]
npm notice === Tarball Contents === 
...                
npm notice === Tarball Details === 
npm notice name:          help                                    
npm notice version:       3.0.2                                   
npm notice filename:      help-3.0.2.tgz                          
npm notice package size:  2.5 kB                                  
npm notice unpacked size: 5.3 kB                                  
npm notice shasum:        96e190d4a0a453b89c2cb4b05ab38e3a8f9fdadd
npm notice integrity:     sha512-jDd0MU+9xzvOQ[...]gHFm4MTefkkpA==
npm notice total files:   10                                      
npm notice 
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in.
npm ERR! need auth You need to authorize this machine using `npm adduser`

Which I believe means it tried to publish the package called help!! Oh no!

I then tried npm help publish as seemed to make more sense, and it suggested "did you mean one of these? publish":

» npm help publish
Top hits for "publish"
————————————————————————————————————————————————————————————————————————————————
npm help scripts                                                      publish:28
npm help package-json                                                 publish:19
npm help publish                                                      publish:17
npm help scope                                                        publish:17
npm help developers                                                   publish:15
npm help unpublish                                                    publish:13
npm help config                                                        publish:7
npm help access                                                        publish:7
npm help npm                                                           publish:7
npm help diff                                                          publish:6
————————————————————————————————————————————————————————————————————————————————
(run with -l or --long to see more context)

Did you mean one of these?
    publish
    unpublish

This was quite confusing!

Also, the buggy npm publish help type suggestion is present in npm install's --help output: it tells you to npm install help which installs the help package into the local directory. 😱

» npm i --help
npm install

Usage:
...

aliases: i, in, ins, inst, insta, instal, isnt, isnta, isntal, add

Run "npm install help" for more info

Expected Behavior:

The suggested command from npm publish --help for additional help should be a valid command, npm help publish should either say there is no help or otherwise not suggest publish when that was the input.

Steps To Reproduce:

See above

Environment:

  • OS: Arch Linux
  • npm version: 7.6.2
  • node: v15.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions