fix: ignore implicit workspaces when running version by Brytoxx021 · Pull Request #10147 · npm/cli · GitHub
Skip to content

fix: ignore implicit workspaces when running version - #10147

Open
Brytoxx021 wants to merge 1 commit into
npm:latestfrom
Brytoxx021:fix/version-implicit-workspace
Open

Brytoxx021 wants to merge 1 commit into
npm:latestfrom
Brytoxx021:fix/version-implicit-workspace

Conversation

@Brytoxx021

Copy link
Copy Markdown

What / Why

Prevent npm version run from inside a workspace directory from implicitly operating on every workspace in the monorepo.

Previously, an implicit workspace caused npm version to call changeWorkspaces(), which enumerated and read all workspace package.json files. When version commands run concurrently across many workspaces, this can race with another process writing a manifest and cause invalid or empty package.json errors.

This change makes npm version handle the current workspace only unless --workspace or --workspaces is explicitly provided. It also adds regression coverage for this behavior.

References

Fixes #<número-del-issue>

References

@Brytoxx021
Brytoxx021 requested a review from a team as a code owner October 20, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant