这是indexloc提供的服务,不要输入任何密码
Skip to content

turbo prune will remove pnpm injectworkspacepackages option from pnpm-lock.yml #10584

@anthonyshew

Description

@anthonyshew

Discussed in #10541

Originally posted by YKDZ June 3, 2025

Summary

Hello everyone. When I worked with the pnpm injectWorkspacePackages option and turbo prune --docker, I found that the settings.injectWorkspacePackages option would be removed from the pnpm-lock.yml generated in the out/ and out/json/ etc, which would cause the pnpm install --frozen-lockfile command in out/json/ throw error ERR_PNPM_LOCKFILE_CONFIG_MISMATCH  Cannot proceed with the frozen installation. The current "settings.injectWorkspacePackages" configuration doesn't match the value found in the lockfile. I want to know if this is expected behavior or a bug?

Additional information

Currently I am using script like this in my Dockerfile to avoid this behavior:

FROM base AS pruner
WORKDIR /repo

COPY . .

RUN turbo prune @cat/app --docker --use-gitignore=false

RUN sed -i '/^settings:/a \  injectWorkspacePackages: true' ./out/pnpm-lock.yaml \
    && sed -i '/^settings:/a \  injectWorkspacePackages: true' ./out/json/pnpm-lock.yaml

Example

https://github.com/YKDZ/turbo-pnpm-injectWorkspacePackages

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