nx icon indicating copy to clipboard operation
nx copied to clipboard

Project name starting with number fails when generating workspace

Open vmasek opened this issue 4 months ago • 0 comments

Current Behavior

Naming project with a leading number seems to fail at the end of running create-nx-workspace

Expected Behavior

The create-nx-workspace should either allow the name to pass or use the same regex as the @nx/workspace:preset to validate the name and demand a change.

GitHub Repo

No response

Steps to Reproduce

  1. run npx create-nx-workspace 4name
  2. pick the defaults for prompts
  3. workspace preset generation fails

Nx Report

Node           : 22.14.0
OS             : win32-x64
Native Target  : x86_64-windows
npm            : 10.9.2

nx                     : 21.2.0
@nx/js                 : 21.2.0
@nx/eslint             : 21.2.0
@nx/workspace          : 21.2.0
@nx/angular            : 21.2.0
@nx/devkit             : 21.2.0
@nx/eslint-plugin      : 21.2.0
@nx/module-federation  : 21.2.0
@nx/playwright         : 21.2.0
@nx/rspack             : 21.2.0
@nx/vite               : 21.2.0
@nx/web                : 21.2.0
@nx/webpack            : 21.2.0
typescript             : 5.8.3
---------------------------------------
Registered Plugins:
@nx/playwright/plugin
@nx/eslint/plugin
---------------------------------------
Community plugins:
@analogjs/vite-plugin-angular : 1.17.1
@analogjs/vitest-angular      : 1.17.1
angular-eslint                : 20.0.0
---------------------------------------
Cache Usage: 0.00 B / 186.22 GB

Failure Logs

NX  Generating @nx/workspace:preset


 NX   The name should match the pattern "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$". The provided value "4name" does not match.

Package Manager Version

NPM 10.9.2

Operating System

  • [ ] macOS
  • [ ] Linux
  • [x] Windows
  • [ ] Other (Please specify)

Additional Information

No response

vmasek avatar Jun 16 '25 09:06 vmasek