Skip to content

changeset publish via pnpm fails where npx changeset publish succeeds #1010

@michaelwarren1106

Description

@michaelwarren1106

Affected Packages

@changesets/cli

Problem

When pnpm is your package manager/script runner and you want to run all your scripts via pnpm commands, for some reason the publish command fails with 404s on the npm info section, which I believe causes the actual publish to also fail.

For more context, I have a monorepo with a working successful publish mechanism that relies on changeset publish and its output. I recently converted to pnpm for other reasons, and went to convert my npx changeset publish command to pnpm changeset publish (added the dependency locally to the project also) expecting everything to work normally. Nothing else config-wise has changed. My .npmrc setup has not changed.

When running locally, I can verify the 404s on the npm info step and the subsequent failures. CICD jbs also fail the same way. If i run npx changeset publish in the exact same setup, the npm info step succeeds and the publish steps move forward as expected.

I dont have a repro for this just yet since its an internal repo, but wanted to report it.

Proposed solution

  1. pnpm changeset publish should work as expected.
  2. An official recipe from changesets in a pnpm environment would be really helpful

Extra context

I noticed on the pnpm docs describing using changesets, the docs there say to just run a special pnpm publish -r command, and I find that strange. Seems like there is some plumbing that changeset needs that pnpm needs to hijack in their special command? Also the output from the pnpm publish command seems to be the same as running npm publish, so it doesnt seem like its actually running the changesets cli command, since the output is different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions