Tomas Schier
Tomas Schier

Reputation: 407

Typescript version conflict in Visual Studio Code

I have an Angular2 project created with the angular-cli project templates in Visual Studio Code. Also, I installed the latest version of Typescript (2.0.3) via npm as well as via the Microsoft link (https://www.microsoft.com/en-us/download/details.aspx?id=48593) because I also use Visual Studio 2015. However, for some reason the I still get an error message when I start my Angular2 project. Note that even with a standard command prompt running tsc -v will still return 1.0.0.0.

What am I missing here? Appreciate your help.

enter image description here

Upvotes: 1

Views: 1067

Answers (3)

httpete
httpete

Reputation: 2983

The best way is to allow VScode to only use the version of typescript installed locally.

Drop this in your .vscode/.settings file.

    "typescript.tsdk": "./node_modules/typescript/lib"

Upvotes: 1

Sagi
Sagi

Reputation: 9284

If you only need the last version of TypeScript, on both Visual Studios, then you can

  1. delete all previous installations which are located in:
    C:\Program Files (x86)\Microsoft SDKs\TypeScript.
  2. reinstall the latest TypeScript version.

Hopefully everything will work.

Upvotes: 1

wtfzn
wtfzn

Reputation: 538

Did you install TypeScript via NPM? If this is the case, try uninstalling it via npm uninstall -g typescript. Now reinstall it via npm install -g typescript and check if the problem is solved.

Upvotes: 1

Related Questions