Skip to content

pnpm downloads binaries for other platforms even with explicit supportedArchitectures #11702

Description

@AhmedBaset

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

11.1.2

Which area(s) of pnpm are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

  • set supportedArchitectures
  • run pnpm add -D nx

Describe the Bug

even though i explicitly define my spec (os, cpu, and libc)

supportedArchitectures:
  os:
    - linux
  cpu:
    - x64
  libc:
    - glibc

pnpm still downloads binaries for macos, freebsd and windows

Downloading @nx/nx-win32-arm64-msvc@22.7.1: 6.57 MB/6.57 MB, done
Downloading @nx/nx-linux-arm64-musl@22.7.1: 8.64 MB/8.64 MB, done
Downloading @nx/nx-darwin-arm64@22.7.1: 7.72 MB/7.72 MB, done
Downloading @nx/nx-freebsd-x64@22.7.1: 8.43 MB/8.43 MB, done
Downloading @nx/nx-linux-arm-gnueabihf@22.7.1: 8.66 MB/8.66 MB, done
Downloading @nx/nx-darwin-x64@22.7.1: 8.00 MB/8.00 MB, done
Downloading @nx/nx-win32-x64-msvc@22.7.1: 7.00 MB/7.00 MB, done

pnpm-lock.yaml

  nx@22.7.1:
    dependencies:
       ...
    optionalDependencies:
      '@nx/nx-darwin-arm64': 22.7.1
      '@nx/nx-darwin-x64': 22.7.1
      '@nx/nx-freebsd-x64': 22.7.1
      '@nx/nx-linux-arm-gnueabihf': 22.7.1
      '@nx/nx-linux-arm64-gnu': 22.7.1
      '@nx/nx-linux-arm64-musl': 22.7.1
      '@nx/nx-linux-x64-gnu': 22.7.1
      '@nx/nx-linux-x64-musl': 22.7.1
      '@nx/nx-win32-arm64-msvc': 22.7.1
      '@nx/nx-win32-x64-msvc': 22.7.1
    transitivePeerDependencies:
      - debug

# ...

  '@nx/nx-darwin-arm64@22.7.1':
    resolution: ...
    cpu: [arm64]
    os: [darwin]

  '@nx/nx-darwin-x64@22.7.1':
    resolution: ...
    cpu: [x64]
    os: [darwin]

  '@nx/nx-freebsd-x64@22.7.1':
    resolution: ...
    cpu: [x64]
    os: [freebsd]

  '@nx/nx-linux-arm-gnueabihf@22.7.1':
    resolution: ...
    cpu: [arm]
    os: [linux]

  '@nx/nx-linux-arm64-gnu@22.7.1':
    resolution: ...
    cpu: [arm64]
    os: [linux]
    libc: [glibc]

  '@nx/nx-linux-arm64-musl@22.7.1':
    resolution: ...
    cpu: [arm64]
    os: [linux]
    libc: [musl]

  '@nx/nx-linux-x64-gnu@22.7.1':
    resolution: ...
    cpu: [x64]
    os: [linux]
    libc: [glibc]

  '@nx/nx-linux-x64-musl@22.7.1':
    resolution: ...
    cpu: [x64]
    os: [linux]
    libc: [musl]

  '@nx/nx-win32-arm64-msvc@22.7.1':
    resolution: ...
    cpu: [arm64]
    os: [win32]

  '@nx/nx-win32-x64-msvc@22.7.1':
    resolution: ...
    cpu: [x64]
    os: [win32]

I also reproduced this behavior in v10.33.4

Discord thread: https://discord.com/channels/731599538665553971/1503400934464553094/1503808624651276402

Expected Behavior

it only installs @nx/nx-linux-x64-gnu

Which Node.js version are you using?

24.15.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

Ubuntu 24.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions