成功构建,但打字稿键入文件中存在许多错误 [英] Successful build with many errors in typescript typing files
问题描述
我有一个问题,Visual Studio 2013 在使用打字稿定义文件构建 Web 应用程序时会产生太多错误.例如,考虑以下场景:
I have a problem with Visual Studio 2013 generating too many errors when building a web application with typescript definition files. For example consider the following scenario:
- 启动一个新的空 Web 应用程序
- 右键单击项目并选择管理 Nuget 包
- 添加 jquery 和 jquery 类型(我下载的类型是几天前的)
- 构建项目
- 项目构建成功,有 100 多个错误(错误,不是警告),都在 jquery.d.ts 中,如下所示:
- ',' 预期.
- '=' 预期.
- 需要标识符.
当我用 angularjs 而不是 jquery 做同样的事情时,我得到了类似的结果.
I get similar results when I do the same with angularjs instead of jquery.
有什么想法吗?
推荐答案
最可能的原因是您使用的 TypeScript 版本比定义作者旧.
The most likely reason for this is that you are using an older version of TypeScript than the definition author.
该语言发展迅速,1.4 版中的某些功能在定义文件中特别有用,因此您可能需要升级到 1.4 版,以便您的机器能够理解这些新功能.
The language is moving swiftly and some of the features in version 1.4 are particularly useful in definition files, so it is likely that you will need to upgrade to 1.4 so that your machine can understand these new features.
这篇关于成功构建,但打字稿键入文件中存在许多错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!