当我尝试使用angular的文档将其升级到版本9时,我得到了以下对等依赖错误:
包"@angular/compiler-cli"缺少对等依赖项"tslib"@"^ 1.10.0"。包"@angular/animations"缺少对等依赖项"tslib"@"^ 1.10.0"。包"@angular/common"缺少对等依赖项"tslib"@"^ 1.10.0"。包"@angular/compiler"缺少对等依赖项"tslib"@"^ 1.10.0"。包"codelyzer"对"@angular/compiler"有不兼容的对等依赖(需要"祝辞= 2.3.1 & lt; 8.0.0 | |祝辞7.0.0-beta & lt; 8.0.0"(扩展),将安装"9.1.13"。包"@angular/core"缺少对等依赖项"tslib"@"^ 1.10.0"。包"codelyzer"对"@angular/core"有不兼容的对等依赖。(需要"祝辞= 2.3.1 & lt; 8.0.0 | |祝辞7.0.0-beta & lt; 8.0.0"(扩展),将安装"9.1.13"。包"@angular/forms"缺少对等依赖项"tslib"@"^ 1.10.0"。包"@angular/platform-browser"缺少对等依赖项"tslib"@"^ 1.10.0"。包"@angular/http"@angular/platform-browser"(需要"7.2.16"(扩展),将安装"9.1.13"。包"@angular/platform-browser-dynamic"缺少对等依赖项"tslib"@"^ 1.10.0"。包"@angular/router"缺少对等依赖项"tslib"@"^ 1.10.0" .
依赖项如下:
"dependencies": {
"@angular/animations": "^8.2.14",
"@angular/cdk": "^7.3.7",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/forms": "^8.2.14",
"@angular/http": "^7.2.16",
"@angular/material": "^7.3.7",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"@angular/router": "^8.2.14",
"@types/underscore": "^1.8.8",
"ang-jsoneditor": "^1.6.2",
"core-js": "^2.4.1",
"cors": "^2.8.4",
"hammerjs": "^2.0.8",
"jsoneditor": "^5.24.7",
"jsoneditor2": "^1.0.0",
"lodash": "^4.17.20",
"moment": "^2.24.0",
"ng-multiselect-dropdown": "0.2.4",
"ngx-ace-wrapper": "^7.3.0",
"ngx-ui-loader": "^7.2.2",
"rxjs": "^6.6.3",
"rxjs-compat": "^6.6.3",
"underscore": "^1.9.1",
"zone.js": "^0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.803.29",
"@angular/cli": "^8.3.29",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "^8.2.14",
"@compodoc/compodoc": "^1.1.11",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.5.0",
"express": "^4.16.3",
"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",
"mini-css-extract-plugin": "^0.8.0",
"protractor": "^5.3.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "^3.5.3"
}
任何建议吗?
--force
标志是唯一对我有效的东西:
ng update --force @angular/core@9 @angular/cli@9
对我来说什么都没用。所以我手动将tslib的版本更改为它所抱怨的版本…这招奏效了!