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
Improve Clarity of packageManager Checksum Notation #726
The packageManager field in package.json currently uses a + symbol to separate the package manager version from its checksum (e.g., "pnpm@10.7.0+sha512..."). This + notation can be misleading for developers, as it is commonly associated with version ranges or build metadata in other contexts (e.g., 1.0.0+build123). This leads to potential misinterpretation, where users might incorrectly assume it signifies "version 10.7.0 or higher" rather than an exact version with an associated integrity hash.
The checksum is intended to enforce an exact, immutable match for the package manager's binary, ensuring reproducibility and security. The current + symbol, however, can obscure this exactness.
Proposed Solution
We propose changing the separator between the package manager version and its checksum from + to =.
Using = would more clearly convey that the hash represents an exact match for the preceding version, eliminating ambiguity and aligning better with the deterministic nature of the checksum. This change would:
Improve Clarity: Make it immediately obvious that the entire string after @ is a precise identifier, not a flexible range.
Reduce Misinterpretation: Prevent developers from mistakenly assuming version compatibility beyond the exact specified version.
Enhance User Experience: Reduce cognitive load and potential confusion, especially for new users or those less familiar with Corepack's specific notation.
Current Behavior
Corepack correctly uses the hash for integrity verification. The issue is purely with the visual representation and the potential for misinterpretation due to the + symbol's common usage in other versioning schemes.
changed the title [-]Corepack version string should use `=` character for clarity instead of `+`[/-][+]Improve Clarity of `packageManager` Checksum Notation[/+]on Jul 13, 2025
Appending the checksum onto a version specifier was a poor choice from the outset. The checksum belongs in some sort of lockfile, NOT in package.json.
The reason for using + is because the semver package and similar tooling does tolerate the + without affecting version precedence. If you try to use semver to parse a malformed version string (like one with a =), it will throw an error.
That is, I think this is not worth doing.
Reacted by Steven, Antoine du Hamel, Mike McCready and RahulGautamSingh
Appending the checksum onto a version specifier was a poor choice from the outset. The checksum belongs in some sort of lockfile, NOT in package.json.
The reason for using + is because the semver package and similar tooling does tolerate the + without affecting version precedence. If you try to use semver to parse a malformed version string (like one with a =), it will throw an error.
That is, I think this is not worth doing.
I don't care about the specifics. Just fix the confusion.
Activity
AMDphreak commentedon Jul 13, 2025
What do you think @rotu @aduh95
[-]Corepack version string should use `=` character for clarity instead of `+`[/-][+]Improve Clarity of `packageManager` Checksum Notation[/+]rotu commentedon Jul 14, 2025
+is because thesemverpackage and similar tooling does tolerate the+without affecting version precedence. If you try to usesemverto parse a malformed version string (like one with a=), it will throw an error.That is, I think this is not worth doing.
AMDphreak commentedon Jul 22, 2025
I don't care about the specifics. Just fix the confusion.
arcanis commentedon Jul 22, 2025
I'm fine with the syntax as it is.
rotu commentedon Jul 22, 2025
The only confusing thing to me is that it visually appears to be a package name specifier even though it has different semantics.
It's well-documented here:
corepack/README.md
Lines 89 to 114 in 0b492c9
perhaps that documentation is not discoverable enough?