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 install - Bundled dependencies are not saved to package.json #3174

Closed
CodyEakins opened this issue Apr 30, 2021 · 5 comments
Closed
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@CodyEakins
Copy link

CodyEakins commented Apr 30, 2021

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.

@CodyEakins CodyEakins 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 Apr 30, 2021
@wraithgar wraithgar self-assigned this May 6, 2021
@wraithgar wraithgar added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels May 6, 2021
@wraithgar
Copy link
Member

--save-bundle is a valid config flag and should be showing up in the help output, so there are two bugs here: the missing behavior and the incorrect help output.

@CodyEakins
Copy link
Author

CodyEakins commented May 7, 2021

--save-bundle is a valid config flag and should be showing up in the help output, so there are two bugs here: the missing behavior and the incorrect help output.

I can write another issue if you'd like. Please make this issue more about the missing behavior; not the documentation issue.

@wraithgar
Copy link
Member

It is, that is just a note for whoever picks this up.

@menduz
Copy link

menduz commented Jul 22, 2021

Hello, is there something we can do to help with this issue? It is affecting our operations at the Decentraland Community

@wraithgar
Copy link
Member

fixed by #4387 (and docs update is in #4388)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

3 participants