Skip to content

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

Description

@robanders

Current Behavior

running the command

npx -y create-nx-workspace@22.7.6 nx-demo --preset=empty --no-interactive

results in the following package.json

{
  "name": "@org/source",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {},
  "private": true,
  "dependencies": {},
  "devDependencies": {
    "@nx/js": "23.0.1",
    "@swc-node/register": "1.11.1",
    "@swc/core": "1.15.8",
    "@swc/helpers": "0.5.18",
    "@types/node": "^24.0.0",
    "nx": "23.0.1",
    "prettier": "^3.8.1",
    "tslib": "^2.3.0",
    "typescript": "~6.0.3"
  },
  "workspaces": [
    "packages/*"
  ]
}

note the difference between the specified Nx version 22.7.6 in the creation command and "nx": "23.0.1" in the package.json

Expected Behavior

the workspace should be created with the specified Nx version

GitHub Repo

No response

Steps to Reproduce

  1. run npx -y create-nx-workspace@22.7.6 nx-demo --preset=empty --no-interactive
  2. look at the resulting package.json

Nx Report

Node           : 26.3.0
OS             : darwin-arm64
Native Target  : aarch64-macos
npm            : 10.9.2
daemon         : Available

nx (global)    : 22.7.5
nx             : 23.0.1
@nx/js         : 23.0.1
@nx/workspace  : 23.0.1
@nx/devkit     : 23.0.1
typescript     : 6.0.3
---------------------------------------
Registered Plugins:
@nx/js/typescript
---------------------------------------
Cache Usage: 0.00 B / 92.64 GB

Failure Logs

Package Manager Version

npm 10.9.2

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions