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
{{ message }}
Repository navigation
Commit 27122a6
Browse filesBrowse the repository at this point in the historyBrowse files
fix(scripts): scope a hoisted npm copy by the ranges it satisfies
The alert sweep treated the hoisted root copy of a package as serving every
manifest that declares it. A workspace whose declared range that copy does
not satisfy has a nested copy of its own, so for it the root copy is only
transitive. #5481 got the wrong fix (raise src/filesystem's range) and the
wrong scope label (server-filesystem) because of it.
npmDeclarers now returns each declarer's range, and npmCopyDeclarers counts
the root copy as a manifest's only when semver.satisfies holds. The
EOVERRIDE warning is now given only when the root package.json declares the
package, which is npm's actual rule (verified against npm 11.20: a
workspace's declaration installs cleanly under a package-wide override).
Closes#5506
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
? `**Add a parent-scoped [\`overrides\`](${DEPENDENCIES_DOC}) entry** in the root \`package.json\` for the nested copies below:\n\n\`\`\`json\n${scopedOverrideExample(nested,group)}\n\`\`\`\n\n${unscopable ? ` A copy at the top of a workspace's own \`node_modules\` names no parent in its path; \`npm explain ${group.package}\` shows which dependency pulls it in, to scope the entry under.\n\n` : ""} A package-wide \`"${group.package}": "${group.fixedIn}"\` would fail with \`EOVERRIDE\`, because a manifest also declares \`${group.package}\` directly. **Not** \`npm audit fix\`, which can resolve an advisory by silently downgrading.`
736
+
? `**Add a parent-scoped [\`overrides\`](${DEPENDENCIES_DOC}) entry** in the root \`package.json\` for the nested copies below:\n\n\`\`\`json\n${scopedOverrideExample(nested,group)}\n\`\`\`\n\n${unscopable ? ` A copy at the top of a workspace's own \`node_modules\` names no parent in its path; \`npm explain ${group.package}\` shows which dependency pulls it in, to scope the entry under.\n\n` : ""} A package-wide \`"${group.package}": "${group.fixedIn}"\` would fail with \`EOVERRIDE\`, because the root \`package.json\` also declares \`${group.package}\` directly. **Not** \`npm audit fix\`, which can resolve an advisory by silently downgrading.`
719
737
: `**Add an [\`overrides\`](${DEPENDENCIES_DOC}) entry** in the root \`package.json\` pinning \`${group.package}\` to \`>=${group.fixedIn}\`, for the copies below, which no declared range reaches. **Not** \`npm audit fix\`, which can resolve an advisory by silently downgrading.`,
720
738
);
721
739
}
@@ -737,7 +755,7 @@ function pipFix(group, { declaredSpec }) {
737
755
738
756
/**
739
757
* @param {ReturnType<typeof groupAlerts>[number]} group narrowed to what applies
0 commit comments