angular - 存储库不干净。请在更新 Angular 8 之前提交或存储任何更改

标签 angular typescript git angular-cli angular8

错误

Repository is not clean. Please commit or stash any changes before updating

当我从版本 7 更新到 Angular 8 时。

Angular 升级指南 https://update.angular.io/#7.0:8.0

  D:\app-test> ng update @angular/cli @angular/core
               npm cache verify

Repository is not clean. Please commit or stash any changes before updating.

更新版本

    PS D:\app-test> ng update
                Using package manager: 'npm'
                Collecting installed dependencies...
                Found 58 dependencies.
                    We analyzed your package.json, there are some packages to update:

                      Name                               Version                  Command to update
                     --------------------------------------------------------------------------------
                      @angular/cdk                       7.2.2 -> 8.0.1           ng update @angular/cdk
                      @angular/core                      7.2.15 -> 8.0.1          ng update @angular/core
                      @angular/core                      7.2.2 -> 7.2.15          ng update @angular/core
                      @angular/material                  7.3.7 -> 8.0.1           ng update @angular/material
                      rxjs                               6.3.3 -> 6.5.2           ng update rxjs


                    There might be additional packages that are outdated.
                    Run "ng update --all" to try to update all at the same time.

                PS D:\app-test> ng update @angular/cdk
                Repository is not clean.  Please commit or stash any changes before updating.

我检查过项目中没有安装 git。

有效的解决方案

   git commit 

谷歌搜索后,我发现这发生在 Angular 8 之后。

错误

https://github.com/angular/angular-cli/issues/14600

最佳答案

这是 Angular 8 中的一个错误

您可以使用以下方式解决此问题:

ng update @angular/cli @angular/core --allow-dirty

关于angular - 存储库不干净。请在更新 Angular 8 之前提交或存储任何更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56773528/

相关文章:

Angular2 与 angularjs 丑化

json - Angular 8和导入Json

git - 如何通过错误修复更新标签

Angular 4 :leave animation not triggering

git - 我的 shell 提示看起来像这样 : ➜ ~ git:(master) ✗. 我怎样才能恢复我的正常提示?

git - merge 没有提交信息的分支

javascript - 在 Angular 2 组件内的 javascript 中访问 Typescript 变量值

javascript - 显示包含对象和图标的数组

typescript - 如何准备 lib 以兼容 tree-shaking?

javascript - 类似数组/映射的数据结构,具有对项目的唯一 ID 支持、O(1) get() 方法且无重复