fix: improve the error messages related to trustPolicy mismatch (#10203)

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
bteaandZoltan Kochan authored and GitHub committed 2025-11-22 02:35:19 +01:00
1 parent df1af144aa
commit 144ce0e98b
2 files changed
+8 -1

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@pnpm/npm-resolver": patch
---
Improve the error messages related to `trustPolicy` mismatch.
+3 -1
View File
@@ -52,7 +52,9 @@ export function failIfTrustDowngraded (
'TRUST_DOWNGRADE',
`High-risk trust downgrade for "${meta.name}@${version}" (possible package takeover)`,
{
hint: `Earlier versions had ${prettyPrintTrustEvidence(strongestEvidencePriorToRequestedVersion)}, ` +
hint: 'Trust checks are based solely on publish date, not semver. ' +
'A package cannot be installed if any earlier-published version had stronger trust evidence. ' +
`Earlier versions had ${prettyPrintTrustEvidence(strongestEvidencePriorToRequestedVersion)}, ` +
`but this version has ${prettyPrintTrustEvidence(currentTrustEvidence)}. ` +
'A trust downgrade may indicate a supply chain incident.',
}