简体   繁体   中英

Compile errors in Angular 2 VS 2015 quickstart project

I am new to TypeScript and Angular 2. To use Angular 2 in my project, I have followed the instruction as given in Angular 2 VS 2015 QuickStart .

But now when I compile the solution, there are 120 errors, mostly with Error Examples like:

Cannot find name 'describe'>br/> Cannot find name 'beforeEach'
Cannot find name 'it'
Cannot find name 'expect'
....
....
....

I googled for the solution but not found any correct one. All solutions seem not related to my problem, also provided solutions are not as per beginners point of understanding.

For Example:
1. One solution written is to include a link like this:
/// <reference path="jquery/jquery.d.ts" /> but where I include this link, no decription there at all

  1. Another one like: npm install @types/node --save-dev where to do this, so that required files get include in my project.

Above I tried to explain my problem, please help me in finding the right fix to my issues.

Thanks in advance

Are you using Visual Studio Update 3?

On https://angular.io/docs/ts/latest/cookbook/visual-studio-2015.html#!#prereq1 :

The minimum requirement for developing Angular 2 applications with Visual Studio is Update 3. Earlier versions do not follow the best practices for developing applications with TypeScript. To view your version of Visual Studio 2015, go to Help | About Visual Studio.

Thanks to all you guys, issue is now fixed

@Pratik, with your comment, I just checked versions, TS is of older version, I just updated it and it worked.

@Michael, Thanks for giving me clue to look around names, these all related TS, and hence by updating TS version, fixed.

Thanks again.

just one more help needed related to some good links to learn Angular 2 with TS for beginners

For all who compiling typescript with ng cli - you can just forbid the VS to touch your ts files. Just open .csproj file and add

<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>

to the first

<PropertyGroup>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM