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 references deprecated flag --production #8025

Open
2 tasks done
dellch opened this issue Jan 13, 2025 · 2 comments
Open
2 tasks done

[DOCS] npm install references deprecated flag --production #8025

dellch opened this issue Jan 13, 2025 · 2 comments
Labels
Documentation documentation related issue Needs Triage needs review for next steps

Comments

@dellch
Copy link

dellch commented Jan 13, 2025

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

The deprecated --production flag is used when it should likely be --omit=dev in cli/docs/lib/content/commands/npm-install.md here on lines 55-62.

Potential Solution

I suggest using:

  • --omit=dev instead of the deprecated flag --production, and
  • --include=dev instead of the --production=false.

This matches the change made for the npm prune documentation in #6987

With the --omit=dev flag (or if the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies. To install all modules listed in both dependencies and devDependencies when the NODE_ENV environment variable is set to production, you can use --include=dev.

NOTE: The --omit=dev flag has no particular meaning when adding a dependency to a project.

Affected URL

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

@dellch dellch added Documentation documentation related issue Needs Triage needs review for next steps labels Jan 13, 2025
@dellch
Copy link
Author

dellch commented Jan 13, 2025

I have opened #8026 to address this.

@ljharb
Copy link
Contributor

ljharb commented Jan 13, 2025

production is a much better and clearer flag name than “omit dev”, and i think it’d be better to remove the deprecation then to double down on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation documentation related issue Needs Triage needs review for next steps
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants