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

[DOCS] npm install --help out of sync with npm help install #6467

Open
2 tasks done
m4rch3n1ng opened this issue May 18, 2023 · 7 comments
Open
2 tasks done

[DOCS] npm install --help out of sync with npm help install #6467

m4rch3n1ng opened this issue May 18, 2023 · 7 comments
Labels
Documentation documentation related issue Priority 2 secondary priority issue

Comments

@m4rch3n1ng
Copy link
Contributor

m4rch3n1ng commented May 18, 2023

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 install --help shows save-peer as an available option while both npm help install and docs.npmjs.com make no mention of it.

i'm on npm version 9.6.7

$ npm install --help
Install a package

Usage:
npm install [<package-spec> ...]

Options:
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global]
[--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]
[--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
[--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces] [--include-workspace-root] [--install-links]

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

Run "npm help install" for more info

also related to this is that the npm install --help command does not mention the shorthand options -D, -P, ..., tho i was unsure if that is intentional

Potential Solution

No response

Affected URL

https://docs.npmjs.com/cli/v9/commands/npm-install

@m4rch3n1ng m4rch3n1ng added Documentation documentation related issue Needs Triage needs review for next steps labels May 18, 2023
@m4rch3n1ng m4rch3n1ng changed the title [DOCS] npm install --help out of sync with `npm help install [DOCS] npm install --help out of sync with npm help install May 18, 2023
@wraithgar
Copy link
Member

The long form description of save probably needs a good chunk of extra copy in it to include the flags that the short form usage is including

cf

define('save', {

@wraithgar wraithgar added Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels May 19, 2023
@kashyapkaki
Copy link
Contributor

@wraithgar Should we append short forms (-D, -P) along with save definition usage?

@wraithgar
Copy link
Member

No I think just the -- versions.

@wraithgar
Copy link
Member

I meant all of these --save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle

@wraithgar
Copy link
Member

We need some sort of coupling like we are doing with exclusive where if save is in the usage attribute on a command, it will also include the other configs that are bundled w/ that config in concept.

@kashyapkaki
Copy link
Contributor

If I understand correctly, save-dev and save-prod definitions already present in the code isn't it? So, do we just need to update the doc or description or usage may be? Please guide me if I'm in wrong path.

@wraithgar
Copy link
Member

The docs pages automatically get populated with the configs that are included in the usage attribute of their relevant command. save is a special case because it has "related" configs that we wanted to include on the cli help output, but didn't also find a way to include them when the docs page renders.

So the fix for this is going to be a little deeper in the code that most things. It's gonna require desiging this mechanism that the docs rendering code will know to look for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation documentation related issue Priority 2 secondary priority issue
Projects
None yet
Development

No branches or pull requests

3 participants