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] shrinkwrap and bundledDependencies not respected for aliased packages #2343

Closed
dominykas opened this issue Dec 14, 2020 · 1 comment
Closed
Labels
Bug thing that needs fixing Release 6.x work is associated with a specific npm 6 release

Comments

@dominykas
Copy link

dominykas commented Dec 14, 2020

Current Behavior:

When a package has a shrinkwrap which includes an aliased dependency (e.g. "lodash4": "npm:lodash@^4.17.19"), it will installed the latest version of that dependency that matches the range in the package.json, but not the version that is in the shrinkwrap, when installing with the -g flag.

Example: aliased

https://github.com/dominykas/test-things/blob/a6ea7ed9bc24dfcec2b6fab55c9d9c98cfbc1b46/npm-shrinkwrap.json#L7-L11

/Users/dominykas/.nvm/versions/node/v12.20.0/lib
├─┬ @dominykas/test-things@0.0.0-development.1
│ └── lodash4@npm:lodash@4.17.20

Example: unaliased

https://github.com/dominykas/test-things/blob/16287e485849ab28fa493a8d32791a55f84ab4bd/npm-shrinkwrap.json#L7-L11

/Users/dominykas/.nvm/versions/node/v12.20.0/lib
├─┬ @dominykas/test-things@0.0.0-development.2
│ └── lodash@4.17.19

Expected Behavior:

Shrinkwrap should be respected.

The same behavior is exhibited with bundledDependencies when they are aliased.

This only works correctly when you're running npm install in a folder which contains the shrinkwrap (but not when installing globally or as a dependency).

Environment:

  • npm: v6.14.9

npm@next-7 seems to deal with this correctly.

@dominykas dominykas added Bug thing that needs fixing Needs Triage needs review for next steps Release 6.x work is associated with a specific npm 6 release labels Dec 14, 2020
@dominykas dominykas changed the title [BUG] shrinkwrap and bundledDependencies not respected for aliased packages when installing globally [BUG] shrinkwrap and bundledDependencies not respected for aliased packages Dec 14, 2020
@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label Feb 13, 2021
@darcyclarke
Copy link
Contributor

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

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

No branches or pull requests

2 participants