【发布时间】:2017-05-14 15:48:03
【问题描述】:
您好,我正在使用 PrimeNg 数据表,它似乎无法在 teamcity 上构建。以下是错误
(CompileTypeScriptWithTSConfig 目标)-> node_modules\primeng\components\datatable\datatable.d.ts(180,14): 错误 TS1005:构建:预期为“=”。 node_modules\primeng\components\datatable\datatable.d.ts(180,25): 错误 TS1005:构建:';'预计。
知道 Visual Studio 编译失败的原因。打字似乎有问题,我需要在这个文件中手动修复这个问题吗?
这些行之前的一些行是
PreComputeCompileTypeScriptWithTSConfig:
[13:34:52][步骤 1/1] C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe --project "E:\buildagent\work\2be75659b1819119\src\MyProject.Client\e2e\tsconfig.json"
[13:34:52][步骤 1/1] C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe --project "E:\buildagent\work\2be75659b1819119\src\MyProject.Client\src\tsconfig.json"
[13:34:52][步骤 1/1] CompileTypeScriptWithTSConfig:[13:34:52][步骤 1/1] C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe --project "E:\buildagent\work\2be75659b1819119\src\MyProject.Client\e2e\tsconfig.json"
[13:34:54][步骤 1/1] C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe --project "E:\buildagent\work\2be75659b1819119\src\MyProject.Client\src\tsconfig.json"
我的 tsconfig 在下面
{
"compileOnSave": false,
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"mapRoot": "/",
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": false,
"outDir": "../dist/",
"rootDir": ".",
"sourceMap": true,
"target": "es5",
"inlineSources": true
},
"files": [
"main.ts",
"typings.d.ts"
],
"exclude": [
"../node_modules/*",
"typings",
"**/*-aot.ts"
]
}
为什么不忽略 node_modules 编译
【问题讨论】:
-
首先,您使用的是哪个版本的 PrimeNg?其次,向我们展示您的 tsconfig 和编译任务,以确定您正在转译哪些 TypeScript 文件。
-
我正在使用“primeng”:“^1.0.0”
-
我认为问题是 tsc 正在尝试编译 node_modules 文件,我似乎无法忽略此文件夹。
标签: visual-studio angular compiler-errors typescript-typings primeng