feat(core): add multiple Nx version detection to nx report#33599
Merged
FrozenPandaz merged 2 commits intomasterfrom Nov 25, 2025
Merged
feat(core): add multiple Nx version detection to nx report#33599FrozenPandaz merged 2 commits intomasterfrom
FrozenPandaz merged 2 commits intomasterfrom
Conversation
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
View your CI Pipeline Execution ↗ for commit 9d7c099
☁️ Nx Cloud last updated this comment at |
4be557f to
6ee1e24
Compare
6ee1e24 to
896d635
Compare
896d635 to
9c962e8
Compare
AgentEnder
approved these changes
Nov 24, 2025
|
|
||
| // Find all nx package versions that don't match the workspace version | ||
| for (const nodeName of Object.keys(graph.externalNodes)) { | ||
| if (nodeName.startsWith('npm:nx@') || nodeName === 'npm:nx') { |
Member
There was a problem hiding this comment.
graph.externalNodes[nodeName].data.packageName
| } | null; | ||
| } | ||
|
|
||
| function extractPackageNameFromNodeId(nodeId: string): string { |
Member
There was a problem hiding this comment.
Probably not needed, node.data.packageName
AgentEnder
approved these changes
Nov 24, 2025
AgentEnder
approved these changes
Nov 24, 2025
4867e7b to
493fb7a
Compare
c2ba6d4 to
6de69d1
Compare
Detect when multiple versions of the nx package are installed in the workspace and report the dependency chain that led to each version. This helps users understand why multiple versions exist and how to resolve the issue. The report shows: - Each detected Nx version - The dependency chain from workspace root to that version - A helpful message about potential issues with multiple versions
6de69d1 to
e18d83a
Compare
FrozenPandaz
added a commit
that referenced
this pull request
Nov 25, 2025
## Current Behavior When multiple versions of the `nx` package are installed in a workspace (e.g., due to a third-party package incorrectly depending on nx), users have no visibility into this issue through `nx report`. ## Expected Behavior The `nx report` command now detects when other packages depend on a different version of nx than the workspace version and reports this clearly:⚠️ Multiple Nx versions detected Your workspace uses nx@20.0.0, but other packages depend on a different version: - some-package → @scope/tool → nx@19.0.0 These packages should not have nx as a dependency. Please report this issue to the package maintainers. Run pnpm why nx@19.0.0 for more details. This helps users identify and report problematic packages that bundle their own version of nx. ## Related Issue(s) N/A - This is a proactive improvement to help users diagnose workspace issues.
Contributor
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
When multiple versions of the
nxpackage are installed in a workspace (e.g., due to a third-party package incorrectly depending on nx), users have no visibility intothis issue through
nx report.Expected Behavior
The
nx reportcommand now detects when other packages depend on a different version of nx than the workspace version and reports this clearly:Your workspace uses nx@20.0.0, but other packages depend on a different version:
These packages should not have nx as a dependency. Please report this issue to the package maintainers.
Run pnpm why nx@19.0.0 for more details.
This helps users identify and report problematic packages that bundle their own version of nx.
Related Issue(s)
N/A - This is a proactive improvement to help users diagnose workspace issues.