Visitar URL original
v11: `verifyDepsBeforeRun` and optimistic repeat install ignore version `overrides`, so a touched package.json looks outdated · Issue #17127 · pnpm/pnpm · GitHub
Skip to content

v11: verifyDepsBeforeRun and optimistic repeat install ignore version overrides, so a touched package.json looks outdated #17127

Closed

Description

@jidesakin

Verify latest release

  • I verified that the issue exists in the latest pnpm release (latest v11: 11.28.6. Not reproducible on 12.14.0.)

pnpm version

11.28.6 (also 11.6.0)

Which area(s) of pnpm are affected?

CLI, installation (verifyDepsBeforeRun, optimisticRepeatInstall)

Reproduction steps

mkdir repro && cd repro
echo '{ "name": "repro", "private": true, "dependencies": { "is-number": "^7.0.0" } }' > package.json
printf 'overrides:\n  is-number: 7.0.0\n' > pnpm-workspace.yaml

pnpm install                  # lockfile importer gets `specifier: 7.0.0` (the override)
touch package.json            # same content, newer mtime: a formatter, a codegen step, git checkout
pnpm --config.verify-deps-before-run=error exec node -e 0

On 11.28.6:

[ERR_PNPM_VERIFY_DEPS_BEFORE_RUN] The lockfile in /…/repro does not satisfy project of id .

On 12.14.0, the same steps pass. With "is-number": "7.0.0" in package.json (the override's exact value), 11.28.6 passes too.

The same check drives optimisticRepeatInstall. After the touch, pnpm install skips the "Already up to date" fast path and runs the full install. With nodeLinker: hoisted that's a real relink. With "esbuild": "^0.25.0" overridden to 0.25.10, it prints Packages: -25: the skipped other-platform @esbuild/* packages, counted as removed.

Describe the Bug

The lockfile stores the overridden specifier for each importer (specifier: 7.0.0). Once a manifest's mtime is newer than lastValidatedTimestamp, checkDepsStatus calls assertWantedLockfileUpToDate. That compares the raw package.json specifier (^7.0.0) with the lockfile's (7.0.0) without applying overrides, so any project whose specifier differs from an override counts as outdated. pnpm install --frozen-lockfile itself applies the overrides and correctly reports "Lockfile is up to date".

Where this hurts:

  • verifyDepsBeforeRun: error fails pnpm run/exec after any package.json write.
  • verifyDepsBeforeRun: install (the default) and optimisticRepeatInstall run a full install where nothing changed.
  • Tools that rewrite package.json during a build trigger it on every build. expo prebuild rewrites the ios/android scripts, and EAS Build runs pnpm install right after it.

How we found it: on 11.6.0 with nodeLinker: hoisted, that extra full install sometimes never exited after Done in … (the #12297 worker-pool hang, fixed in 11.23.0). It hung our EAS builds in their Prebuild step. We probably hit it earlier on Railway (Linux) too, where verifyDepsBeforeRun started an install before pnpm run that never exited. We worked around it by writing every typescript specifier as exactly the override's version.

Expected Behavior

As on 12.14.0: when the lockfile satisfies the manifest once overrides are applied, a touched package.json is up to date. verify-deps-before-run=error passes, and pnpm install takes the "Already up to date" path.

A possible fix: in assertWantedLockfileUpToDate (deps/status), apply the parsed overrides to each manifest before satisfiesPackageManifest, the way install's read-package hook does. Alternatively, accept a lockfile specifier that equals an override applying to that dependency.

Which Node.js version are you using?

22.23.3

Which operating systems have you used?

  • macOS (arm64). The EAS builds where it surfaced ran on macOS too.

Drafted with Claude Code. I reproduced it on 11.6.0, 11.28.6 and 12.14.0.

Activity

  1. github-actions commented on Oct 19, 2026

    @github-actions
    Contributor

    @jidesakin, are you planning to open a pull request for this? If so, reply here and a maintainer will assign the issue to you, so nobody else starts on the same fix.

  2. self-assigned this
    on Oct 19, 2026
  3. zkochan commented on Oct 20, 2026

    @zkochan
    Member

    Opened #17148 to fix this across both TypeScript (pnpm v11) and Rust (pnpm v12):

    • pnpm v11 (@pnpm/deps.status): assertWantedLockfileUpToDate now constructs readPackageHook via createReadPackageHook (covering overrides, packageExtensions, hooks.readPackage, and ignoredOptionalDependencies), applies it to a cloned copy of the project manifest before satisfiesPackageManifest and linkedPackagesAreUpToDate, passes resolution, injectWorkspacePackages, and hookedManifests to linkedPackagesAreUpToDate, and respects per-project packageConfigs overrides when sharedWorkspaceLockfile is false.
    • pnpm v12 (pnpm-package-manager): optimistic_repeat_install::manifest_agreement already applied VersionsOverrider in check_importer_satisfies, and now also applies VersionsOverrider before linked_packages_are_up_to_date so linked workspace dependencies rewritten by overrides stay up to date when a manifest is edited.

    This covers the entire issue.


    Generated with Antigravity (Gemini 4 Argon (Medium))

  4. added a commit that references this issue on Oct 20, 2026
    dc34aeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions