You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Publishing with yarn should be done via yarn npm publish but @changesets/cli is using npm publish instead. This means some workspaces features that are yarn specific do not work as expected. For instance, when publishing with yarn npm publish yarn replaces inner packages with version workspace:^ with the correct version. While when publishing with npm publish npm ignores packages with version workspace:^. This results in incorrectly published packages because when installing it package managers won't be able to resolve workspace:^.
I believe the above is also the reason why .yarnrc.yml is ignored when publishing via changesets.
This is simple to reproduce:
In a monorepo managed by yarn create packages "@example/a" and "@example/b".
The package.json of @example/a contains @example/b as a dependency:
"dependencies": {
"@example/b": "workspace:^"
}
Create a changeset for @example/a.
Generate the new versions via changeset version.
Then publish via changeset publish.
Now install the new version in a new project and check the package.json in the node_modules and also the new info added to yarn.lock. You'll see workspace:^ hasn't been replaced.
The proposed solution is to use yarn npm publish instead of npm publish. I tested this out in a private monorepo and it works. I also opened a PR for this change here and would like help getting it reviewed and approved.
This issue is pretty urgent for us at my company. Any guidance on how to move this forward would be very much appreciated.
Reacted by Uriy, Ilya Kibardin, John Ayeni, Amin Benselim, QL-Anton, Seongmin Park, Sobition, Alireza Heydari, Bruno Sampaio, Mikel and 31 more
Activity
shmdhussain commentedon Sep 24, 2025
Is this issue closed by the PR humanprotocol/human-protocol#3539?
hanselninja commentedon Oct 24, 2025
No, that's a separate repo, they're just mentioning that
yarn changeset publishdoesn't work for them because of the reason mentioned in this issue.manulera commentedon Dec 15, 2025
was this ever fixed?
fix: publish packages with Yarn (#168)