-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Open
Labels
needs: repro stepsWe cannot reproduce the issue with the information givenWe cannot reproduce the issue with the information given
Description
Command
update
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
Angular 20 CLI updater
Description
Running ng update @angular/core@21 @angular/cli@21 on an Angular 20 project fails immediately with:
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 21.1.4 to perform the update.
Using package manager: npm
Collecting installed dependencies...
Found 42 dependencies.
An unhandled exception occurred: Invalid Version:
See "/tmp/ng-ikfuQW/angular-errors.log" for further details.
Even using --migrate-only or npx @angular/cli@21 triggers the same error.
Direct npm installation of Angular 21 packages works, but the updater cannot run migrations.
Minimal Reproduction
- Create an Angular 20 project (e.g.,
ng new test20with CLI 20.x). - Optionally add Angular Material or ESLint packages (version 20).
- Run: ng update @angular/core@21 @angular/cli@21
- Observe the error: An unhandled exception occurred: Invalid Version:
See "/tmp/ng-XXXXX/angular-errors.log" for further details.
Exception or Error
TypeError: Invalid Version:
at new SemVer (/tmp/angular-cli-packages-tDrRUS/node_modules/semver/classes/semver.js:40:13)
at compare (/tmp/angular-cli-packages-tDrRUS/node_modules/semver/functions/compare.js:5:3)
at Object.gte (/tmp/angular-cli-packages-tDrRUS/node_modules/semver/functions/gte.js:4:30)
at shouldForcePackageManager (/tmp/angular-cli-packages-tDrRUS/node_modules/@angular/cli/src/commands/update/utilities/cli-version.js:187:20)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async UpdateCommandModule.run (/tmp/angular-cli-packages-tDrRUS/node_modules/@angular/cli/src/commands/update/cli.js:210:34)
at async UpdateCommandModule.handler (/tmp/angular-cli-packages-tDrRUS/node_modules/@angular/cli/src/command-builder/command-module.js:160:28)
Your Environment
- Angular CLI: 20.3.16
- Angular Core: 20.3.16
- Node: 20.20.0
- NPM: 10.8.2
- OS: Ubuntu 24.04.4 LTS
Anything else relevant?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs: repro stepsWe cannot reproduce the issue with the information givenWe cannot reproduce the issue with the information given