我收到错误:存储库不干净。请先提交或存储任何更改,然后再进行更新

时间:2019-06-24 07:50:02

标签: angular angular6 angular8

我想将我的项目angular6更新为angular8。

首先:运行npm install -g @angular/cli@latest(此代码可以)。

第二:运行ng update @angular/cli @angular/core。 我得到了这个错误:

  

存储库不干净。请先提交或存储任何更改   正在更新。

这是一个简单的angular6项目,只是有一些基本的控制器。

当我运行ng update @angular/cli @angular/core时。我弄错了。

package.json

"dependencies": {
  "@angular/animations": "^6.1.7",
  "@angular/common": "^6.1.7",
  "@angular/compiler": "^6.1.7",
  "@angular/core": "^6.1.7",
  "@angular/forms": "^6.1.7",
  "@angular/http": "^6.1.7",
  "@angular/platform-browser": "^6.1.7",
  "@angular/platform-browser-dynamic": "^6.1.7",
  "@angular/router": "^6.1.7",
  "@ng-bootstrap/ng-bootstrap": "^3.2.0",
  "@types/bootstrap": "^3.3.37",
  "@types/jquery": "^3.3.0",
  "bootstrap": "^4.1.3",
  "core-js": "^2.4.1",
  "jquery": "^3.3.1",
  "rxjs": "^6.3.2",
  "rxjs-compat": "^6.0.0-rc.0",
  "zone.js": "^0.8.26"
},
"devDependencies": {
  "@angular-devkit/build-angular": "~0.8.0",
  "@angular/cli": "^6.2.1",
  "@angular/compiler-cli": "^6.1.7",
  "@angular/language-service": "^6.1.7",
  "@types/jasmine": "~2.8.3",
  "@types/jasminewd2": "~2.0.2",
  "@types/node": "~6.0.60",
  "codelyzer": "^4.4.4",
  "jasmine-core": "~2.8.0",
  "jasmine-spec-reporter": "~4.2.1",
  "karma": "~2.0.0",
  "karma-chrome-launcher": "~2.2.0",
  "karma-coverage-istanbul-reporter": "^1.2.1",
  "karma-jasmine": "~1.1.0",
  "karma-jasmine-html-reporter": "^0.2.2",
  "popper.js": "^1.14.4",
  "protractor": "~5.1.2",
  "ts-node": "~4.1.0",
  "tslint": "~5.9.1",
  "typescript": "~2.9.2"
}

哇,我该怎么办?,我整天都呆在那里。

1 个答案:

答案 0 :(得分:0)

您需要先在git中进行更改,然后才能进行更新,这是您将看到ng更新所做的所有更改。只要做:

git commit

然后重试升级。