将Angular 2.0升级到5.2会产生115个错误

时间:2018-02-06 17:32:23

标签: angular .net-core

我正在使用带有角度的.Net Core 2.0。我最近更新了我的package.json文件中引用的所有Angular包以使用版本5.2.3,我还重新安装了需要升级的Node。

我的package.json文件是:

{
  "version": "1.0.0",
  "name": "asp.net",
  "private": true,
  "scripts": {
    "start": "tsc && concurrently \"tsc -w\" ",
    "tsc": "tsc",
    "tsc:w": "tsc -w"
  },
  "license": "ISC",
  "dependencies": {
    "@angular/common": "^5.2.3",
    "@angular/compiler": "^5.2.3",
    "@angular/core": "^5.2.3",
    "@angular/forms": "^5.2.3",
    "@angular/http": "^5.2.3",
    "@angular/platform-browser": "^5.2.3",
    "@angular/platform-browser-dynamic": "^5.2.3",
    "@angular/router": "^5.2.3",
    "@angular/upgrade": "^5.2.3",
    "angular-in-memory-web-api": "^0.5.3",
    "bootstrap": "^4.0.0",
    "core-js": "^2.5.3",
    "reflect-metadata": "^0.1.12",
    "rxjs": "^5.5.6",
    "systemjs": "^0.20.19",
    "zone.js": "^0.8.20"
  },
  "devDependencies": {
    "@types/core-js": "^0.9.46",
    "@types/node": "^9.4.0",
    "concurrently": "^3.5.1",
    "typescript": "^2.7.1",
    "typings": "^2.1.1"
  }
}

我得到的错误是:

Severity    Code    Description Project File    Line    Suppression State
Error   TS2305  (TS) Module '"J:/MySolution/node_modules/@angular/core/src/util"' has no exported member 'global'.  MySolution (tsconfig project)   J:\MySolution\node_modules\@angular\core\src\core_private_export.d.ts   19  Active
Error   TS2305  (TS) Module '"J:/MySolution/node_modules/@angular/core/src/util"' has no exported member 'looseIdentical'.  MySolution (tsconfig project)   J:\MySolution\node_modules\@angular\core\src\core_private_export.d.ts   19  Active
Error   TS2305  (TS) Module '"J:/MySolution/node_modules/@angular/core/src/util"' has no exported member 'stringify'.   MySolution (tsconfig project)   J:\MySolution\node_modules\@angular\core\src\core_private_export.d.ts   19  Active
Error   TS2305  (TS) Module '"J:/MySolution/node_modules/@angular/core/src/util/decorators"' has no exported member 'Class'.    MySolution (tsconfig project)   J:\MySolution\node_modules\@angular\core\src\util.d.ts  7   Active

所有错误都与角度模块有关,而不是我的代码。

我的tsconfig.json文件是:

{
  "compilerOptions": {
    "noImplicitAny": true,
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": true,
    "target": "es5",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "commonjs",
    "suppressImplicitAnyIndexErrors": true
  },
  "exclude": [
    "node_modules/*"
  ],
  "typeRoots": [
    "node_modules/@types/"
  ]
}

0 个答案:

没有答案