Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lf- opened this issue Mar 11, 2021 · 1 comment · Fixed by #2855
Closed

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

lf- opened this issue Mar 11, 2021 · 1 comment · Fixed by #2855
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@lf-
Copy link

lf- commented Mar 11, 2021

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 📦  help@3.0.2
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
@lf- lf- added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Mar 11, 2021
@ruyadorno
Copy link
Contributor

Fixed in npm@7.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants