微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

打字稿错误“无法写入文件......因为它会覆盖输入文件”

如何解决打字稿错误“无法写入文件......因为它会覆盖输入文件”

似乎通过更新到 Typescript 2.3.x 为我解决了这个问题

此外,使用 Visual Studio 2017 也是一个很大的改进。我强烈建议您进行 两项更新。

解决方法

在 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"]
}

我怎样才能摆脱所有这些错误?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。