成功构建,但打字稿键入文件中存在许多错误 [英] Successful build with many errors in typescript typing files

查看:15
本文介绍了成功构建,但打字稿键入文件中存在许多错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,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:

  1. 启动一个新的空 Web 应用程序
  2. 右键单击项目并选择管理 Nuget 包
  3. 添加 jquery 和 jquery 类型(我下载的类型是几天前的)
  4. 构建项目
  5. 项目构建成功,有 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.

在此处下载 1.4 版.

这篇关于成功构建,但打字稿键入文件中存在许多错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆