Skip to content

fix(core): pin template nx packages to the invoked create-nx-workspace version - #36192

Draft
llwt wants to merge 2 commits into
masterfrom
create-nx-workspace-issue
Draft

llwt wants to merge 2 commits into
masterfrom
create-nx-workspace-issue

Conversation

@llwt

@llwt llwt commented Jul 1, 2026

Copy link
Copy Markdown
Member

Current Behavior

npx create-nx-workspace@22.7.6 my-workspace --preset=empty --no-interactive produces a workspace pinned to the latest Nx release (currently 23.0.1) instead of 22.7.6. Presets like empty are remapped to GitHub templates (nrwl/empty-template), and the template flow clones the template repo's default branch HEAD with git clone --depth 1. The template repos always track the latest Nx release and have no version tags, so the version of create-nx-workspace the user invokes never influences the resulting workspace's Nx version. Users deliberately staying on an older major silently get the newest one.

Expected Behavior

The workspace is created with the Nx version matching the invoked create-nx-workspace version. After cloning a template and before installing dependencies, nx and all @nx/* entries in the template's root package.json are rewritten to the running CLI's nxVersion. All Nx packages publish in lockstep, so a single version string is correct for all of them; the nested package.json files in the template repos declare no Nx dependencies, so a root-only rewrite is sufficient. For create-nx-workspace@latest this is a no-op since the template already pins the same version.

Related Issue(s)

Fixes #36190


View session information ↗

@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 39fe324
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6a744c1371b52c0008cc7949
😎 Deploy Preview https://deploy-preview-36192--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 39fe324
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6a744c139bade30008246297
😎 Deploy Preview https://deploy-preview-36192--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud

nx-cloud Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 39fe324

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 17m 15s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 6s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 55s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 17s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2026-08-06 09:17:19 UTC

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We update updateNxVersions to also bump eslint to ^9.0.0 whenever @nx/eslint is present in the template, preventing the npm ERESOLVE peer-dependency conflict that arises when @nx/eslint@24 (which requires ESLint 9+) is pinned into a template that still declares eslint@~8.57.0. The fix introduces an optional peerDependencyOverrides parameter to updateNxVersionsInContent/updateNxVersions and passes { eslint: eslintVersion } from create-workspace.ts so that only templates using @nx/eslint are affected.

Note

We are verifying this fix by re-running e2e-workspace-create:e2e-ci--src/create-nx-workspace-base-templates.test.ts.

Warning

The suggested diff is too large to display here, but you can view it on Nx Cloud ↗


Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally JCHS-5kJ0

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating workspace with specific Nx 22 version results in Nx 23 dependencies in package.json

1 participant