Skip to content

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

@dellch

Description

@dellch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentationdocumentation related issueNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions