mirror of
https://github.com/pnpm/pnpm.git
synced 2026-06-30 10:55:23 -04:00
4.7 KiB
4.7 KiB
@pnpm/env.system-node-version
1100.1.1
Patch Changes
- @pnpm/cli.meta@1100.0.4
1100.1.0
Minor Changes
-
3ddde2b: fix: anchor the side-effects-cache key and global-virtual-store hash to the project's script-runner Node —engines.runtimepin when present, shellnodeotherwise — instead of pnpm's own runtime.ENGINE_NAME(the<platform>;<arch>;node<major>prefix used as the side-effects-cache key and the engine portion of the GVS hash) was computed fromprocess.version— the Node that runs pnpm itself. That was wrong in two situations:@pnpm/exeSEA bundle. The bundle has its own embedded Node, not thenodeon the user'sPATHthat actually spawns lifecycle scripts. Two pnpm installations on the same machine (one SEA, one npm-package) therefore disagreed on the cache key, partitioning the side-effects cache and the global virtual store across two Node majors even though both installs would run scripts on the same shellnode.engines.runtime/devEngines.runtimepin. When a project pins a Node version viadevEngines.runtime(pnpm v11+), pnpm downloads that Node intonode_modules/node/and uses it to run lifecycle scripts. But the hash still anchored to whichever Node ran pnpm itself, not to the pinned Node — so two installs of the same project with two different runner Nodes would still disagree on the GVS slot path even though scripts run on the same pinned Node.
Three changes:
@pnpm/engine.runtime.system-node-versionnow exportsengineName(nodeVersion?). Resolves the version in this order: explicit override →getSystemNodeVersion()(which already prefersnode --versionoverprocess.versionin SEA contexts) →process.version.@pnpm/deps.graph-hashernow exportsfindRuntimeNodeVersion(snapshotKeys)— scans an iterable of lockfile snapshot keys for anode@runtime:<version>entry and returns its bare version string.calcDepStateandcalcGraphNodeHash/iterateHashedGraphNodesaccept anodeVersion?(in the options bag for the first, as a trailing parameter / ctx field for the others), forwarded toengineName(). The default (no override) preserves the pre-change behaviour. The legacyENGINE_NAMEconstant in@pnpm/constantsis unchanged so external consumers and existing tests keep working; in non-SEA, non-pinned contexts every value lines up.- Every install-side caller of the graph-hasher (
@pnpm/installing.deps-resolver,@pnpm/installing.deps-restorer,@pnpm/installing.deps-installer,@pnpm/building.during-install,@pnpm/building.after-install,@pnpm/deps.graph-builder) now derives the project's pinned runtime viafindRuntimeNodeVersion(Object.keys(graph))once per invocation and threads it through.
On upgrade, two one-time GVS slot churns are possible:
- SEA-pnpm users without a runtime pin: slots that previously hashed under the embedded-Node major (e.g.
node26) now hash under the shell-Node major (e.g.node24), matching what pacquet, the npm-publishedpnpmpackage, and any other pnpm-compatible tool already produce. - Projects with a
devEngines.runtimepin: slots that previously hashed under the runner's Node major now hash under the pinned Node major, matching what the lifecycle scripts will actually run on.
In both cases the old slots become prune-eligible.
1100.0.3
Patch Changes
- @pnpm/cli.meta@1100.0.3
1100.0.2
Patch Changes
1100.0.1
Patch Changes
- @pnpm/cli.meta@1100.0.1
1001.0.0
Major Changes
Patch Changes
1000.0.11
Patch Changes
- @pnpm/cli-meta@1000.0.11
1000.0.10
Patch Changes
- @pnpm/cli-meta@1000.0.10
1000.0.9
Patch Changes
- @pnpm/cli-meta@1000.0.9
1000.0.8
Patch Changes
- @pnpm/cli-meta@1000.0.8
1000.0.7
Patch Changes
- @pnpm/cli-meta@1000.0.7
1000.0.6
Patch Changes
- @pnpm/cli-meta@1000.0.6
1000.0.5
Patch Changes
- @pnpm/cli-meta@1000.0.5
1000.0.4
Patch Changes
- @pnpm/cli-meta@1000.0.4
1000.0.3
Patch Changes
- @pnpm/cli-meta@1000.0.3
1000.0.2
Patch Changes
- @pnpm/cli-meta@1000.0.2
1000.0.1
Patch Changes
- @pnpm/cli-meta@1000.0.1
1.0.1
Patch Changes
e476b07: Don't crash if theuse-node-versionsetting is used and the system has no Node.js installed #8769.
1.0.0
Major Changes
d04f7f2: Initial release.