Skip to content

pnpm-workspace.yaml make pnpm link not working #9506

@magicdawn

Description

@magicdawn

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)

CLI

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

https://github.com/magicdawn/pnpm-demo

Reproduction steps

  • cd /tmp; mkdir pnpm-demo; cd pnpm-demo;
  • pnpm init
  • pnpm add esbuild
  • pnpm approve-builds this will create pnpm-workspace.yaml

pnpm link with pnpm-workspace.yaml exists

  • run pnpm link
  • expected: link pnpm-demo to global
  • actual happend:
    • add self to dependencies:
      "dependencies": {
        "pnpm-demo": "link:"
      }
    • nothing linked

rm pnpm-workspace.yaml & pnpm link

work as expected

steps

I have a gif recorded:

Image

I think it's related to recent change of write onlyBuiltDependencies to pnpm-workspace.yaml but not package_json.pnpm.onlyBuiltDependencies even if it's not a monorepo

Describe the Bug

pnpm link not working with pnpm-workspace.yaml present

Expected Behavior

pnpm link with no arguments, should link current package to global.

Which Node.js version are you using?

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions