ASP.NET 5 MVC6 Angular 2 (Beta 0) - 重复承诺

ASP.NET 5 MVC6 Angular 2 (Beta 0) - duplicate promise

您好,

我在 MVC6 Angular (Beta 0) 项目上收到构建错误。 我正在尝试设置位于以下位置的项目: https://angular.io/guide/quickstart

"Duplicate identifier 'Promise'"

它似乎在两者中都有定义:

我的tsconfig.json如下:

{
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules",
    "wwwroot"
  ]
}

如果我将上面的设置更改为 es6,我会得到更多的错误。 例如。

上的重复标识符

完成、EPSILON、标志、MAX_SAFE_INTEGER、Promise、PropertyKey、原型、大小、值。

我真的很挣扎,我希望尽可能避免任何 'hacks'。

注意:我使用的是 VS2015 Update 1(在构建时自动编译为 TS)。

我的package.json如下:

{
  "name": "ASP.NET",
  "version": "0.0.0",
  "scripts": {
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "lite": "lite-server",
    "start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
  },
  "dependencies": {
    "angular2": "2.0.0-beta.0",
    "systemjs": "0.19.6",
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.0",
    "zone.js": "0.5.10"
  },
  "devDependencies": {
    "gulp": "3.8.11",
    "gulp-concat": "2.5.2",
    "gulp-cssmin": "0.1.7",
    "gulp-uglify": "1.2.0",
    "rimraf": "2.2.8",
    "concurrently": "^1.0.0",
    "lite-server": "^1.3.1",
    "typescript": "^1.7.3"
  }
}

我很感激在该领域工作的解决方案,但如果可能的话请不要修改。

建议您删除 typingsnode_modules 目录和 tsd.json 然后,npm install && tsd init && tsd install angular2 --resolve --save 因为您似乎有一些遗产。 angular typings 将如下所示(无承诺): screenshot