nx
nx copied to clipboard
Project name starting with number fails when generating workspace
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
- run
npx create-nx-workspace 4name - pick the defaults for prompts
- 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