Skip to content

[Bug?]: npm publish with --json output is missing scope in workspace name #6946

@florianloechle

Description

@florianloechle

Self-service

  • I'd be willing to implement a fix

Describe the bug

When running yarn npm publish with the --json flag, the output omits the scope from the package name.

This behavior is inconsistent with other yarn commands like yarn workspaces list --json, which correctly include the full scoped package name.

To reproduce

  1. Run yarn npm publish --json in a scoped workspace.
  2. Observe json output with the name property in it.

Environment

System:
    OS: macOS 26.0.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 22.18.0 - /private/var/folders/1h/vlzzl0ws4xd2lglyrq5317kr0000gn/T/xfs-a46e370f/node
    Yarn: 4.10.3 - /private/var/folders/1h/vlzzl0ws4xd2lglyrq5317kr0000gn/T/xfs-a46e370f/yarn
    npm: 10.9.3 - /Users/xx/.nvm/versions/node/v22.18.0/bin/npm
  npmPackages:
    jest: ^29.3.1 => 29.7.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions