Description
I'm trying to do something that should be utterly trivial: update an Angular CLI 6.1.1 app to the latest version of 6.x.
Apparently, I'm supposed to use ng update
to do this. But I have absolutely no idea what this command actually does, and the docs don't help at all.
Consider:
>ng update
We analyzed your package.json, there are some packages to update:
Name Version Command to update
--------------------------------------------------------------------------------
@angular/cli 6.1.1 -> 6.2.1 ng update @angular/cli
@angular/core 6.1.1 -> 6.1.7 ng update @angular/core
rxjs 6.2.2 -> 6.3.2 ng update rxjs
There might be additional packages that are outdated.
Or run ng update --all to try to update all at the same time.
Hmm...OK, I'm positive that more than cli and core need to be updated. Why aren't the other packages listed? There's a note that "there might be additional packages that are outdated". Might? Can't the CLI see exactly what needs updating?
But OK, let's try it with --all
and use --dry-run
to try and see what will happen:
>ng update --all --dry-run
Package "bootstrap" has a missing peer dependency of "popper.js" @ "^1.14.3".
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.0.3")
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.0.3").
Incompatible peer dependencies found. See above.
OK, now I'm even more confused. Why is ng update
doing anything with bootstrap? And compiler-cli
wasn't even listed in the earlier list. Finally, if ng update
is going to update compiler-cli
, shouldn't it know that typescript
(obviously being a dependency of compiler-cli
) would be getting updated too?
Basically, I have no idea what's going on or what's going to happen if I run ng update --all
. What will be updated? Right now, it sounds like I just have to run it and hope that it knows what it's doing.
I think a lot of confusion could be avoided if the ng update
docs were more than one (vague) sentence long. I'd take a shot at updating the docs myself, but I literally have no idea what this command actually does (other than "it updates something"). Could someone take a few minutes and expand the docs on this command? Because I assume that in-version updates like this are far more common than full version updates.