Skip to content

pnpm --frozen-lockfile skips @node-llama-cpp/linux-x64 when lockfile generated on macOS #567

@IRIS-KELLER

Description

@IRIS-KELLER

Problem

When pnpm-lock.yaml is generated on macOS, pnpm install --frozen-lockfile on a Linux x64 Docker build host does not install @node-llama-cpp/linux-x64.

Observed

  • node-llama-cpp@3.15.1 installed via pnpm
  • @node-llama-cpp/linux-x64 present in lockfile (12 occurrences)
  • pnpm.onlyBuiltDependencies includes node-llama-cpp
  • Yet @node-llama-cpp/linux-x64 absent from node_modules/ after pnpm install --frozen-lockfile on Linux x64

Workaround

Manually fetch the tarball in Dockerfile after pnpm install:

ARG NODE_LLAMA_VER=3.15.1
RUN wget -q "https://registry.npmjs.org/@node-llama-cpp/linux-x64/-/linux-x64-${NODE_LLAMA_VER}.tgz" \
    -O /tmp/nlcpp.tgz \
    && mkdir -p /app/node_modules/@node-llama-cpp \
    && tar -xzf /tmp/nlcpp.tgz -C /tmp/nlcpp-extract \
    && mv /tmp/nlcpp-extract/package /app/node_modules/@node-llama-cpp/linux-x64

Questions

  • Is this a known pnpm cross-platform lockfile limitation?
  • Should postinstall ensure the correct platform binary regardless of lockfile origin?
  • Recommended Docker build pattern for macOS lockfiles targeting Linux x64?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions