You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: workspaces/arborist/lib/shrinkwrap.js
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -929,6 +929,10 @@ class Shrinkwrap {
929
929
continue
930
930
}
931
931
constloc=relpath(this.path,node.path)
932
+
// Drop lockfile entries for extraneous nodes outside node_modules. These are stale workspace entries: the workspace was removed from package.json or its directory was deleted, so it should not be tracked in package-lock.json.
Copy file name to clipboardExpand all lines: workspaces/arborist/test/arborist/reify.js
+59Lines changed: 59 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2055,6 +2055,65 @@ t.test('filtered reification in workspaces', async t => {
2055
2055
'hidden lockfile - foo/x linked, c, old x, removed a')
2056
2056
})
2057
2057
2058
+
// Regression for https://github.com/npm/cli/issues/5463: a workspace whose directory has been deleted should not leave behind an extraneous entry (or a lingering reference in the root's workspaces array) in package-lock.json after `npm install`.
2059
+
t.test('removed workspace is pruned from package-lock.json',asynct=>{
// The lockfile's root.workspaces array mirrors package.json verbatim and is intentionally not mutated here, so we only assert that orphan package/link entries are dropped.
0 commit comments