I recently upgraded a project from Angular 6 to Angular 8. I expected, primarily, this to go through with very few issues but did run into one. The Update Angular site gives a lot of great instructions, but they did not all go smoothly.

Specifically when trying to update the angular/core library I was getting an error similar to this:

view plain print about
1Error: The Angular Compiler requires TypeScript >=3.4.0 and <3.5.0, but 3.5.2 was found instead.
2
3Migration can be rerun with "ng update @angular/core -from 7 to -8 --migrate-only"

First the command they said to use to rerun the upgrade failed. I opened up the package.json and saw this:

view plain print about
1"typescript": "~3.4.5"

If the package.json tells me node to install 3.4.5, why was a later version installed? It took me a while to figure out what the problem was. The '~' before the version number means it can go higher, and in fact 3.5.2 was installed. I was able to address this by manually specifying a version number:

view plain print about
1npm install typescriptg@">=3.4.0 <3.5.0"

Then I reran the update script and things were solved.