Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
I run npm version via ultra-runner or xargs in parallel in >40 workspaces.
One or more calls fail because of "invalid" package.json - in one case (so far) package.json even had been cut to zero bytes.
AFAICT, executing npm version in a single workspace calls changeWorkspaces, which in turn reads every package.json inside the mono-repo via mapWorkspaces. Parallel npm version race, so later calls may find a package.json that has been started to convert (and may be temporarily empty).
Expected Behavior
npm version in a single workspace should not access other workspaces.
This is shown by --no-workspaces which works. But I always would need to remember to include it.
Maybe npm version should internally set --no-workspaces.
Steps To Reproduce
I have no explicit repro, but it's simple: have a workspace tree with ~40 or 50 workspaces.
Use ultra-runner or xargs to execute npm version patch --no-git-tag-version
Environment
- npm: 11.15 (starts with 8, afaict)
- Node.js: 22/24
- OS Name: Linux
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
I run
npm versionvia ultra-runner or xargs in parallel in >40 workspaces.One or more calls fail because of "invalid" package.json - in one case (so far) package.json even had been cut to zero bytes.
AFAICT, executing
npm versionin a single workspace calls changeWorkspaces, which in turn reads every package.json inside the mono-repo via mapWorkspaces. Parallelnpm versionrace, so later calls may find a package.json that has been started to convert (and may be temporarily empty).Expected Behavior
npm versionin a single workspace should not access other workspaces.This is shown by
--no-workspaceswhich works. But I always would need to remember to include it.Maybe
npm versionshould internally set --no-workspaces.Steps To Reproduce
I have no explicit repro, but it's simple: have a workspace tree with ~40 or 50 workspaces.
Use ultra-runner or xargs to execute
npm version patch --no-git-tag-versionEnvironment