与Angular2和VS2013 lib.es6.d.t之间的Typescript构建错误。

时间:2021-06-21 19:41:41

I am working on a new project with Angular2. I am trying to integrate into an existing legacy .NET Web Forms application. I had things working and building up until upgrading my VS2015 to update 2. Since then, I am getting build errors associated to a reference to lib.es6.d.ts in my main.ts file.

我正在和Angular2合作一个新项目。我正在尝试集成到现有的。net Web Forms应用程序中。在升级VS2015更新2之前,我有很多工作要做。从那时起,我就开始在我的main中建立一个与lib.es6.d.ts相关的错误。ts文件。

The errors are like this this for example:

错误就像这样,例如:

Build: ";" expected. ...\node_modules\typescript\lib\lib.es6.d.ts Build: "," expected. ...\node_modules\typescript\lib\lib.es6.d.ts Build: Type expected. ...\node_modules\typescript\lib\lib.es6.d.ts

构建:“,”,“,”,“,”,“,”,“,”,“,”,“,”,“,”,“,”,“,”。

Note, I get these new errors in VS2013 which I have not made any updates recently. I have tried changing configuration of the typescript settings in the project but cannot get it building again. Please suggest what may resolve my issues.

注意,我在VS2013中有这些新的错误,我最近没有做任何更新。我尝试了在项目中更改类型文件设置的配置,但是无法重新构建它。请提出可以解决我的问题的建议。

1 个解决方案

#1


0  

Check '\node_modules\typescript\lib\lib.es6.d.ts' for red line errors/syntax errors, it should show you the area it's complaining about when it says ' "," expected' and '";" expected'. As for 'Type expected', it looks like some property, method, class, etc may be missing an important type (string, number, array, or a class).

检查“\node_modules\typescript\lib\lib.es6.d.ts”的红线错误/语法错误,它应该向您显示它所抱怨的区域:“”、“预期”和“预期”。至于“类型期望”,它看起来像一些属性、方法、类,等等可能缺少一个重要类型(字符串、数字、数组或类)。

This is an example of a typing I found in my lib.es6.d.ts: declare function parseFloat(string: string): number;. If you can locate the red lines/areas producing those 'expected' errors, I would be willing to compare your code with mine in \node_modules\typescript\lib\lib.es6.d.ts.

这是我在lib.es6.d.ts中找到的一个类型的例子:声明函数parseFloat(字符串:string): number;如果您能够找到产生这些“预期”错误的红线/区域,我愿意将您的代码与我的代码(\node_modules\typescript\lib\ lib.d.t)进行比较。

#1


0  

Check '\node_modules\typescript\lib\lib.es6.d.ts' for red line errors/syntax errors, it should show you the area it's complaining about when it says ' "," expected' and '";" expected'. As for 'Type expected', it looks like some property, method, class, etc may be missing an important type (string, number, array, or a class).

检查“\node_modules\typescript\lib\lib.es6.d.ts”的红线错误/语法错误,它应该向您显示它所抱怨的区域:“”、“预期”和“预期”。至于“类型期望”,它看起来像一些属性、方法、类,等等可能缺少一个重要类型(字符串、数字、数组或类)。

This is an example of a typing I found in my lib.es6.d.ts: declare function parseFloat(string: string): number;. If you can locate the red lines/areas producing those 'expected' errors, I would be willing to compare your code with mine in \node_modules\typescript\lib\lib.es6.d.ts.

这是我在lib.es6.d.ts中找到的一个类型的例子:声明函数parseFloat(字符串:string): number;如果您能够找到产生这些“预期”错误的红线/区域,我愿意将您的代码与我的代码(\node_modules\typescript\lib\ lib.d.t)进行比较。