我運行一個角2項目,打字稿,我有很多錯誤,從我的角度網絡模塊打字稿:在庫文件夾排除檢查
[error] node-modules\webjars\@angular\common\src\directives\ng_class.d.ts:80: TS2304 Cannot find name 'Set'.
[error] rawClass: string | string[] | Set<string> | {
[error] ^
[error] node-modules\webjars\@angular\common\src\facade\async.d.ts:33: TS2304 Cannot find name 'Promise'.
[error] static fromPromise(promise: Promise<any>): Observable<any>;
[error] ^
[error] node-modules\webjars\@angular\common\src\facade\async.d.ts:34: TS2304 Cannot find name 'Promise'.
[error] static toPromise(obj: Observable<any>): Promise<any>;
[error]
顯然來了,我不希望我的打字稿檢查這些庫,因此,我已經建立了我的tsconfig.json
如下:
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators":true,
"sourceMap": true,
"noImplicitAny":true,
"noFallthroughCasesInSwitch":true,
"noImplicitReturns":true,
"outDir": "./target/ts"
},
"exclude": [
"node_modules",
"project/target",
"typings/main",
"typings/main.d.ts",
"typings/browser",
"target/web"
]
}
還有什麼我應該做的事?
更奇怪的是,它曾經運行良好,當我從beta-17升級到rc.4時,問題確實出現了 – Scipion