Description
Bug Report
- [x] bug report
Command
- [x] new
Versions
CLI v7.2.0-rc.0
Repro steps
ng new demoapp
The log given by the failure
Install TS 3.2, due to #13226
Desired functionality
Should continue to install TS 3.1.
Mention any other details that might be useful
Angular 7.0 and 7.1 supported TypeScript 3.1 only. Angular 7.2 now supports TypeScript 3.1 and TypeScript 3.2.
But installing TypeScript 3.2 directly is a breaking change, as it means a higher TypeScript version is required for the whole project.
Why? Because Angular 7.2 may support TS 3.2, but any real-world app will also rely on third-party libraries that may not be compatible with TS 3.2 yet, or even that can't be compatible with TS 3.2 (example: one my lib is affected by a regression in TS 3.2).
This is why Angular will only requires TS 3.2 (or newer) in the next major version, but still supports TS 3.1 in minor versions.
This is also confirmed by the CLI code itself which says here:
// These versions should be kept up to date with latest Angular peer dependencies.
But Angular 7.2 peerDependencies
is not TypeScript ~3.2.2
, it's >=3.1.1 <3.3
(see here).
So the CLI may use the latest supported TS 3.2 internally, but should not install the latest one in the project.