Skip to content

pnpm rm in workspace package changes link: to file: with injectWorkspacePackages set to true #9518

Description

@DASPRiD

Verify latest release

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

pnpm version

No response

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

Lockfile

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

https://github.com/DASPRiD/pnpm-issue-workspace-unlinking

Reproduction steps

  • Clone repository
  • Run pnpm i
  • Check pnpm-lock.yaml and see that @pnpm-issue-workspace-unlinking/b has version link:../b
  • CD into packages/a and run pnpm i redis && pnpm rm redis (or any other package, doesn't matter)
  • Check pnpm-lock.yaml again, the version of @pnpm-issue-workspace-unlinking/b is now file:packages/b

Describe the Bug

For some reason, upon package removal in a workspace package, all workspace:* links in the pnpm-lock.yaml file for that package are changed from link: to file: protocol, which breaks how they are included.

Expected Behavior

Workspace packages should stay as version link: protocol.

Which Node.js version are you using?

22.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)

PopOS 22.04

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