集合“ @ schematics / angular / migrations / migration-collection.json”无法解析

时间:2018-06-27 14:09:25

标签: angular npm angular5 angular6

我正在尝试将项目的角度版本更新为V6。但出现以下错误:

$ ng update @angular/cli
  

集合“ @ schematics / angular / migrations / migration-collection.json”无法解析。

Package.json:

"dependencies": {
    "@angular/animations": "^6.0.3",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/core": "^6.0.3",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "core-js": "^2.5.4",
    "rxjs": "^6.0.0",
    "zone.js": "^0.8.26",
    "@angular/cdk": "5.0.0-rc.3",
    "@angular/flex-layout": "^2.0.0-beta.12",
    "@angular/material": "5.0.0-rc.3",
    "angular2-json-schema-form": "^0.7.0-alpha.1",
    "jsoneditor": "^5.14.0"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^6.0.3",
    "@angular-devkit/build-angular": "~0.6.5",
    "typescript": "~2.7.2",
    "@angular/cli": "~6.0.5",
    "@angular/language-service": "^6.0.3",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~1.4.2",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.3.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1"
  }

1 个答案:

答案 0 :(得分:8)

我通过重新安装@ schematics / angular软件包摆脱了这个错误:先npm r @schematics/angular,然后再重新安装npm i @schematics/angular

我在package.json中看不到@schematics/angular,而我的却在dependencies下看到它-因此您可能必须安装它。