Visitar URL original
`pnpm install --frozen-lockfile` now fails when some workspace packages are missing · Issue #16453 · pnpm/pnpm · GitHub
Skip to content

pnpm install --frozen-lockfile now fails when some workspace packages are missing #16453

Closed

Description

@KazimirPodolski

Last pnpm version that worked

12.5.1 (maybe some later versions too)

pnpm version

12.8.2

Code to reproduce the issue

pnpm-workspace.yaml:

packages:
  - server
  - tests
  ...

Dockerfile:

COPY --exclude=tests . ./
RUN pnpm install -r --offline --frozen-lockfile

Expected behavior

#30 0.518 Scope: all 5 workspace projects
#30 0.646 ✓ Lockfile passes supply-chain policies (verified 18h ago)
#30 0.646 Lockfile is up to date, resolution step is skipped
#30 0.815 Already up to date
#30 0.979 Done in 470ms using pnpm v12.5.1

Previously we were able to exclude unrelated workspace packages from the image (smaller image, faster CI build). pnpm install --frozen-lockfile just accepted it.

Actual behavior

#26 0.474 Scope: all 4 workspace projects
#26 0.526 Error: ERR_PNPM_OUTDATED_LOCKFILE
#26 0.527 
#26 0.527   × installing dependencies
#26 0.527   ╰─▶ Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up
#26 0.527       to date with package.json.
#26 0.527       
#26 0.527         Failure reason:
#26 0.527         the lockfile records `importers["tests"]`, but that project's
#26 0.527       directory or package.json is missing
#26 0.527   help: Regenerate the lockfile with `pnpm install --lockfile-only` so that
#26 0.527         pnpm-lock.yaml reflects the current package.json, then re-run `pnpm
#26 0.527         install --frozen-lockfile`.

Additional information

No response

Node.js version

v24.13.0

Operating System

Linux

Contributing a fix

  • I am working on a fix

Activity

  1. changed the title [-]`pnpm install -r --offline --frozen-lockfile` now fails when some workspace packages are missing[/-] [+]`pnpm install --frozen-lockfile` now fails when some workspace packages are missing[/+] on Sep 30, 2026
  2. runspired commented on Sep 30, 2026

    @runspired

    potentially a duplicate of #16428 which had a fix PR committed earlier today

  3. KazimirPodolski commented on Sep 30, 2026

    @KazimirPodolski
    Author

    I'll check when it ships!

  4. tunglambk commented on Oct 1, 2026

    @tunglambk
    Contributor

    I reproduced this on pnpm 12.8.1 with a minimal workspace: generate a lockfile with server and tests importers, remove tests/, then run pnpm install --frozen-lockfile; it fails with ERR_PNPM_OUTDATED_LOCKFILE for the missing importer.

    The failure comes from the missing-importer check added in #15427, which intentionally made an unfiltered frozen install fail when a lockfile-listed project's directory or manifest is missing. A Docker context that excludes one project is indistinguishable to that check from a deleted project. This is a different check from #16428's injected optional-peer freshness issue.

    Before proposing a change that would reverse part of #15427's behavior, can a maintainer clarify the intended contract here? Should Docker builds select the projects present in the build context with --filter, or should pnpm add an explicit way for an unfiltered frozen install to tolerate missing importer directories (which would also tolerate genuinely deleted projects)?


    Written by an agent (Codex, GPT-6).

  5. self-assigned this
    on Oct 1, 2026
  6. zkochan commented on Oct 1, 2026

    @zkochan
    Member

    #16462 restores the pre-12.8.0 behavior for this case. An unfiltered pnpm install --frozen-lockfile now skips a lockfile importer whose project directory is absent, so a Docker build context that excludes tests/ installs again. It still fails if the directory exists without a package.json, which keeps the check from #15427 for that case. The fix covers both pnpm 12 and pnpm 11 and fully addresses this issue.


    Written by an agent (Claude Code, claude-opus-5-5).

  7. added a commit that references this issue on Oct 1, 2026
    3cdea10
  8. hoangzunguyen44-hub commented on Oct 17, 2026

    @hoangzunguyen44-hub

    pnpm install --frozen-lockfile
    cp .env.example .env
    redis-server
    pnpm dev

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