@ Types / node / index.d.ts TypeScript错误TS2309

时间:2016-11-21 17:02:54

标签: angular typescript types npm asp.net-core

我有一个使用SystemJs的.Net Core Angular 2项目,我最近从Typings升级到@Types。

截至2016年12月21日,该项目已针对.Net Core 1.0.1和TypeScript 2.0.10以及Node.js 7.0.0的最新VS工具进行了全面重建。

在更新为@Types之前,项目文件正常工作。

我从@ Types / node / index.d.ts收到以下错误:

TS2309“构建:导出分配不能在具有其他导出元素的模块中使用。” 3626行

@ Types / node / index.d.ts的第3626行是“断言”模块声明的导出。

这是我的配置文件

tsconfig.json

"compilerOptions": {
  "target": "es5",
  "module": "commonjs",
  "moduleResolution": "node",
  "sourceMap": true,
  "emitDecoratorMetadata": true,
  "experimentalDecorators": true,
  "removeComments": false,
  "noImplicitAny": false,
  "skipLibCheck": true
},
"compileOnSave": true,
"exclude": [
  "node_modules",
  "wwwroot/shared/lib"
]

的package.json

"name": "angular-quickstart",
"version": "1.0.0",
"description": "QuickStart package.json from the documentation, supplemented with testing support",
"scripts": {
  "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
  "lite": "lite-server",
  "tsc": "tsc",
  "tsc:w": "tsc -w"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
  "@angular/common": "~2.2.0",
  "@angular/compiler": "~2.2.0",
  "@angular/core": "~2.2.0",
  "@angular/forms": "~2.2.0",
  "@angular/http": "~2.2.0",
  "@angular/platform-browser": "~2.2.0",
  "@angular/platform-browser-dynamic": "~2.2.0",
  "@angular/router": "~3.2.0",
  "@angular/upgrade": "~2.2.0",
  "angular-in-memory-web-api": "~0.1.15",

  "core-js": "^2.4.1",
  "reflect-metadata": "^0.1.8",
  "rxjs": "5.0.0-beta.12",
  "systemjs": "0.19.41",
  "zone.js": "^0.6.26",

  "@progress/kendo-angular-grid": "^0.6.1",
  "@progress/kendo-angular-charts": "^0.9.0",
  "@progress/kendo-angular-dropdowns": "^0.16.10",
  "@progress/kendo-angular-inputs": "^0.13.1",
  "@progress/kendo-angular-layout": "^0.15.0",
  "@progress/kendo-angular-dialog": "^0.12.2",
  "@progress/kendo-angular-upload": "^0.10.4",
  "@progress/kendo-angular-buttons": "^0.13.3",
  "@progress/kendo-angular-popup": "^0.13.2",
  "@progress/kendo-angular-scrollview": "^0.5.1",
  "@progress/kendo-angular-sortable": "^0.5.1",
  "@progress/kendo-data-query": "^0.1.6",
  "@telerik/kendo-theme-default": "^1.28.1",

  "jquery": "2.1.1",
  "jquery-validation": "1.15.1",
  "jquery-validation-unobtrusive": "3.2.6",
  "office-ui-fabric-core": "5.0.1",
  "bootstrap": "3.3.7"
},
"devDependencies": {
  "@types/core-js": "^0.9.34",
  "@types/node": "^6.0.49",
  "@types/jasmine": "2.5.38",
  "concurrently": "^3.0.0",
  "lite-server": "^2.2.2",
  "typescript": "^2.0.10",
  "gulp": "3.9.1",
  "gulp-cssmin": "0.1.7",
  "gulp-concat": "2.6.0",
  "gulp-uglify": "2.0.0",
  "gulp-clean": "0.3.2",
  "gulp-typescript": "2.14.1"
},
"repository": {}
}

1 个答案:

答案 0 :(得分:1)

我们为GitHub上的TypeScript人员提出了建议。

搜索以下内容 -

declare module "assert" {

它应该只在您的项目中出现一次。我们有两个文件 - @ types / node包中的TypeScript定义文件和我们的wwwroot文件夹中的第二个文件,它需要删除并且被Gulp任务错误地复制并且被编译器拾取。希望这有帮助!