gib65
gib65

Reputation: 151

typescript will not compile in visual studio 2015

I need help installing node with support for typescript. I'm working in Visual Studio 2015. It's a web API application.

I'm starting from scratch. This means that I deleted my node_module folder along with my package.json and tsconfig.json files.

Then I followed this guide here:

https://basarat.gitbooks.io/typescript/docs/quick/nodejs.html

It seemed to install the node_module folder with @types in it properly, as well as package.json and tsconfig.json:

http://www.shahspace.com/acm/4640/package.json http://www.shahspace.com/acm/4640/tsconfig.json

But then when I try to compile my project, I get several thousand errors in the typescript file in node_module itself. For example, it tells me: "'(' expected." in node_modules\@types\jquery\index.t.js:

http://www.shahspace.com/acm/4640/index_snippet.d.ts

Why is Visual Studio not able to compile the typescript files in node_modules even though I followed the steps in the guide?

Thanks.

Upvotes: 1

Views: 58

Answers (1)

SJP
SJP

Reputation: 1010

The newest version of jquery requires you to use TypeScript Version 2.3. In order to use Typescript 2.3 in Visual Studio 2015 you need to install a suitable extension, e.g. "TypeScript 2.4.1 for Visual Studio 2015" using your Extension Manager.

After you've installed the Extension you will then receive a notification that you're using an old version of typescript when you next open your project which will prompt you to update the reference. If the error still occurs you can then manually update the Element

<TypeScriptToolsVersion>x</TypeScriptToolsVersion>

to the installed version, e.g. 2.4.1.

More detailed Information on updating TypeScript can be found here.

Upvotes: 0

Related Questions