Skip to content

[BUG] npm install - Bundled dependencies are not saved to package.json #3174

Closed
@CodyEakins

Description

@CodyEakins

Current Behavior:

If you install any package with the bundled dependency flag:

npm install <package-name> --save-bundle

... <package-name> is not added to the bundledDependencies array in your package.json file.

Expected Behavior:

When installing any package with the bundled dependency flag (--save-bundle or -B), the package should be installed and added to the bundledDependencies array in your package.json file.

Steps To Reproduce:

  1. In this environment, create a new directory, step into it, and run npm init.
  2. After creating a plain/empty package.json, run npm install <package-name> --save-bundle.
  3. Open package.json, and discover that the bundledDependencies field does not exist, and <package-name> is not listed within it.

Environment:

  • OS: Ubuntu 20.10
  • Node: 14.15.0
  • npm: 7.11.2

Additional Comments:

Interestingly enough, if you run npm install --help on v7.11.2, you'll see:

npm install [<@scope>/]<pkg>
npm install [<@scope>/]<pkg>@<tag>
npm install [<@scope>/]<pkg>@<version>
npm install [<@scope>/]<pkg>@<version range>
npm install <alias>@npm:<name>
npm install <folder>
npm install <tarball file>
npm install <tarball url>
npm install <git:// url>
npm install <github username>/<github project>

Options:
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
[-E|--save-exact]

Notice that the --save-bundle flag IS NOT documented. However, if you read the v7 npm install docs, you'll see that the bundled dependency flags and behaviors ARE documented.

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 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