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
We use a monorepo. I want pnpm to install the platform packages for the machines we really use. Today pnpm installs many packages that no machine can run.
Our repository has three targets:
developers work on macOS arm64
CI runs on Linux x64 with glibc
one Docker image runs on Linux x64 with musl
That is three platforms. I cannot write three platforms. supportedArchitectures takes three separate lists, and pnpm installs the cartesian product:
This is 2 x 2 x 2. pnpm installs eight combinations. We only use three.
I measured with pnpm 11.9.0 on Node 24.12.0.
The libc line adds 1.0 GB in 44 packages to every developer machine and every CI job.
461 MB of that, in 21 packages, is Linux arm64 musl which is a combination, we don't use.
pnpm installs an optional dependency if it matches one tuple or more.
A missing key means "any value". { os: linux } matches all Linux packages. This could keep configurations short.
The current object form stays valid. pnpm can read it as one tuple that holds lists, so old configurations do not change behaviour.
Describe the drawbacks of your solution
Somewhat two shapes for one setting. The documentation must explain both (list vs. tuplates). Users must choose?
If a user gives a list and an object together, pnpm must reject it with a clear error or define a merge rule.
Describe alternatives you've considered
Declare the needed packages as direct optionalDependencies. This didn't work. pnpm applies the libc filter to optional dependencies even when a project declares them directly. On a glibc machine pnpm skips them. Our Docker build then failed, because the musl binaries were absent.
Per-package scoping, for example a setting that gives one architecture list to one package. I think this is worse. supportedArchitectures describes the machines that will run the install output. It does not describe single packages. Per-package rules also become unclear when two packages want different variants of the same dependency.
Accept the cost 😆
One more thing, I checked the existing issues first and found the following:
Both report that the filter is too weak. This request asks for the opposite, a filter that is more exact. I did not find an existing request for tuples. Please close this issue if one exists.
This discussion was converted from issue #13903 on September 26, 2026 11:07.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Contribution
Describe the user story
We use a monorepo. I want pnpm to install the platform packages for the machines we really use. Today pnpm installs many packages that no machine can run.
Our repository has three targets:
That is three platforms. I cannot write three platforms.
supportedArchitecturestakes three separate lists, and pnpm installs the cartesian product:This is 2 x 2 x 2. pnpm installs eight combinations. We only use three.
I measured with pnpm 11.9.0 on Node 24.12.0.
The libc line adds 1.0 GB in 44 packages to every developer machine and every CI job.
461 MB of that, in 21 packages, is Linux arm64 musl which is a combination, we don't use.
The two largest are:
Describe the solution you'd like
Let supportedArchitectures also accept a list of tuples. Each tuple is one platform:
pnpm installs an optional dependency if it matches one tuple or more.
A missing key means "any value". { os: linux } matches all Linux packages. This could keep configurations short.
The current object form stays valid. pnpm can read it as one tuple that holds lists, so old configurations do not change behaviour.
Describe the drawbacks of your solution
Describe alternatives you've considered
supportedArchitecturesdescribes the machines that will run the install output. It does not describe single packages. Per-package rules also become unclear when two packages want different variants of the same dependency.One more thing, I checked the existing issues first and found the following:
supportedArchitectures#11702 closed by fix: infer missing platform fields of optional dependencies from the package name #12312Both report that the filter is too weak. This request asks for the opposite, a filter that is more exact. I did not find an existing request for tuples. Please close this issue if one exists.
All reactions