pnpm fetch: Skipping Local Dependencies for Docker Builds

Written by Alessio on 2/6/2026

Problem

pnpm fetch failed in Docker builds when workspace packages with file: protocol dependencies weren't available. pnpm fetch only downloads from the registry, so local dependencies that won't exist in the Docker build context shouldn't block the fetch.

Solution

Added ignoreLocalPackages option passed from the fetch command to skip local dependencies during graph building. Local file: protocol dependencies are now filtered out before the fetch attempt.

Result

pnpm fetch now works in Docker builds without failing on missing local workspace dependencies.

Commit: pnpm/pnpm@312226c
PR: #10514