【发布时间】:2017-03-05 14:45:41
【问题描述】:
在 Visual Studio 2015 Update 3 的 Typescript 2.2.1 项目中,我在错误列表中收到数百个错误,例如:
无法写入文件 'C:/{{my-project}}/node_modules/buffer-shims/index.js',因为它会覆盖输入文件。
看起来总是这样。它实际上并没有阻止构建,并且一切正常,但是错误列表会分散注意力,并且很难在发生“真实”错误时找到它们。
这是我的tsconfig.json 文件
{
"compileOnSave": true,
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"noImplicitAny": true,
"removeComments": true,
"sourceMap": true,
"target": "ES5",
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"typeRoots": [],
"types": [] //Explicitly specify an empty array so that the TS2 @types modules are not acquired since we aren't ready for them yet.
},
"exclude": ["node_modules"]
}
我怎样才能摆脱所有这些错误?
【问题讨论】:
-
我也遇到了这个问题:/ 我检查了 github github.com/Microsoft/TypeScript/issues,但我看不到这个问题的票。你做了一个吗?
-
好主意,我现在有了! github.com/Microsoft/TypeScript/issues/14538
-
您找到解决这个@ChrisBarr 的方法了吗?我有同样的问题。请也看看。 stackoverflow.com/questions/44457138/…
-
@Sampath 在某种程度上我有...... TypeScript 的更新似乎已经为我解决了这个问题。此外,我已切换到 Visual Studio 2017,这也是一个很大的改进,我从未在那里看到此错误。
-
好的,谢谢。希望你能发布你自己的答案然后你可以关闭这个线程不是吗? @ChrisBarr
标签: visual-studio typescript visual-studio-2015 typescript2.0