-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[BUG] npm i
always pretends it "added 4 packages"
#1813
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Do you still see this with the latest v7 release? I can't reproduce this one. |
I see this with v7.0.0-beta.11. Is there a more recent version? Full output of the repro:
|
ah, it has to do with optional dependencies @isaacs, easy to reproduce with
|
When using `omit: 'optional'` option the reify diff should not count optional deps into its diff tree. Fix: npm/cli#1813
The added count on lib/utils/reify-output.js only looks up resulting keys from arb.diff and does not take into account the fact that some of these pkgs signaled as diff=ADD might in fact not have been installed, most common scenario are optional deps that could have failed their install in a given system or opt-out from configs. This fixes the counting number by looking up at arb.inventory and confirming it has the node that has been marked as added on diff result. Fix: npm#1813
The added count on lib/utils/reify-output.js only looks up resulting keys from arb.diff and does not take into account the fact that some of these pkgs signaled as diff=ADD might in fact not have been installed, most common scenario are optional deps that could have failed their install in a given system or opt-out from configs. This fixes the counting number by looking up at arb.inventory and confirming it has the node that has been marked as added on diff result. Fix: #1813 PR-URL: #1858 Credit: @ruyadorno Close: #1858 Reviewed-by: @nlf
The added count on lib/utils/reify-output.js only looks up resulting keys from arb.diff and does not take into account the fact that some of these pkgs signaled as diff=ADD might in fact not have been installed, most common scenario are optional deps that could have failed their install in a given system or opt-out from configs. This fixes the counting number by looking up at arb.inventory and confirming it has the node that has been marked as added on diff result. Fix: #1813 PR-URL: #1858 Credit: @ruyadorno Close: #1858 Reviewed-by: @nlf
Hi @targos thanks for reporting this one! 😄 It should now be fixed in latest beta release: Let us know in case you find more issues, these were super helpful 😊 Thanks again! |
Current Behavior:
With the provided reproduction steps, everytime
npm i
is executed, the output is:Expected Behavior:
Since the dependencies were previously installed with
npm ci
,npm i
should be a no-op.Steps To Reproduce:
See https://github.com/targos/npm7-cra#issue-3-npm-i-always-pretends-it-added-4-packages
Environment:
The text was updated successfully, but these errors were encountered: