我在我的项目中使用 Angular 8,并想升级到 Angular 9。
我遵循升级指南,当我运行命令时:
ng update @angular/core @angular/cli
,
我收到一条错误消息:
An unhandled exception occurred: 403 Forbidden - GET https://registry.npmjs.org/@angular%2fcli
更新:403 错误消失了,但现在我收到以下错误:
Package "@angular/core" has a missing peer dependency of "tslib" @ "^1.10.0".
Package "codelyzer" has an incompatible peer dependency to "@angular/core" (requires ">=2.3.1 <8.0.0 || >7.0.0-beta <8.0.0" (extended), would install "9.0.1").
Package "@angular/compiler-cli" has a missing peer dependency of "tslib" @ "^1.10.0".
Package "@angular/animations" has a missing peer dependency of "tslib" @ "^1.10.0".
Package "@angular/forms" has a missing peer dependency of "tslib" @ "^1.10.0".
Package "@angular/common" has a missing peer dependency of "tslib" @ "^1.10.0".
Package "@angular/platform-server" has a missing peer dependency of "tslib" @ "^1.10.0".
Package "@angular/compiler" has a missing peer dependency of "tslib" @ "^1.10.0".
Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.3.1 <8.0.0 || >7.0.0-beta <8.0.0" (extended), would install "9.0.1").
Package "@angular/service-worker" has a missing peer dependency of "tslib" @ "^1.10.0".
Package "@angular/router" has a missing peer dependency of "tslib" @ "^1.10.0".
Package "@angular/platform-browser-dynamic" has a missing peer dependency of "tslib" @ "^1.10.0".
Package "@angular/platform-browser" has a missing peer dependency of "tslib" @ "^1.10.0".
Package "@angular/http" has an incompatible peer dependency to "@angular/platform-browser" (requires "7.0.4" (extended), would install "9.0.1").
已解决: 我已将 tslib 添加到 package.json