Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
fix: missing bins info in package-lock
Browse files Browse the repository at this point in the history
When migrating from package-lock v1 -> v2 in a project that currently
has an actual tree + a package-lock file the reify process fails to
properly update the package-lock with the bins info.

This fixes it by setting build-ideal-tree to always inflate old
lockfiles even if `complete: true` isn't set.

Fixes: npm/cli#1957
  • Loading branch information
ruyadorno committed Nov 12, 2020
1 parent 22d5095 commit 2741da6
Show file tree
Hide file tree
Showing 18 changed files with 945 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/arborist/build-ideal-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
const { meta, inventory } = this.idealTree
const ancient = meta.ancientLockfile
const old = meta.loadedFromDisk && !(meta.originalLockfileVersion >= 2)
if (inventory.size === 0 || !(ancient || old && this[_complete]))
if (inventory.size === 0 || !(ancient || old))
return

// if the lockfile is from node v5 or earlier, then we'll have to reload
Expand Down
Loading

0 comments on commit 2741da6

Please sign in to comment.