How to target a specific TypeScript version?

1.6k views Asked by At

I've update my Angular 2 project to RC1 and the router to v3 alpha3. I'm getting such errors:

node_modules/@angular/router/directives/router_outlet.d.ts(10,14): error TS1005: '=' expected.

The error seem to be a TypeScript version issue. I seem to be need to use TypeScript 1.9.0-dev.20160409 version or higher. I've added "typescript": "^1.9.0-dev.20160409" to devDependencies but didn't helped, I'm still getting same errors. What else should I do?

2

There are 2 answers

0
dstr On BEST ANSWER

You can use this method to upgrade your VS.NET to a specific version: https://github.com/Microsoft/TypeScript/wiki/Nightly-drops#visual-studio-2013-and-2015

When you reopen the project VS.NET will ask that if you want to upgrade the project's TypeScript version. If you say yes it will update the TypeScriptToolsVersion value in the csproj file.

0
Maximilian Riegler On

It seems, that the latest TypeScript compiler version for Visual Studio 2015 is 1.8.6. In your project file you can set the node <TypeScriptToolsVersion> to 1.9. To use version 1.9 just download it and place it in C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.9\tsc.exe.