ng从7更新到8不会更新代码

时间:2019-10-08 17:29:47

标签: angular angular-cli

我想将角度7更新为8。这就是我所做的。首先,我运行了yarn upgrade --latest。我注意到这将为我提供3.6.3的打字稿,它对于angular来说太新了,因此我将其降级为3.5.3。现在,当我尝试运行我的应用程序时,出现很多错误(例如@ViewChild缺少参数)

因此,我认为可以通过ng update -all来解决:

$> ng update --all
Using package manager: 'yarn'
Collecting installed dependencies...
Found 66 dependencies.
              Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.4 <3.6", would install "3.6.3").
Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.

它想将typescript更新为3.6.3。现在,当我使用--force运行此命令时,它实际上仅更新打字稿。看来:ng update --all === yarn upgrade --latest

我的问题是,ng update是否也可以修复我的代码,给我留下了深刻的印象,但是我看不到这种魔力。

0 个答案:

没有答案