Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install TypeScript?

I have version 0.9.1.1. So I ran the following:

C:\test>npm install -g typescript
npm http GET https://registry.npmjs.org/typescript
npm http 200 https://registry.npmjs.org/typescript
npm http GET https://registry.npmjs.org/typescript/-/typescript-1.0.0.tgz
npm http 200 https://registry.npmjs.org/typescript/-/typescript-1.0.0.tgz
C:\Users\david\AppData\Roaming\npm\tsc -> C:\Users\david\AppData\Roaming\npm\nod
e_modules\typescript\bin\tsc
[email protected] C:\Users\david\AppData\Roaming\npm\node_modules\typescript

But when I run tsc I get:

C:\test>tsc
Version 0.9.1.1
Syntax:   tsc [options] [file ..]

What else do I need to do to install the latest version?

Update:

C:\test>where tsc
C:\Program Files (x86)\Microsoft SDKs\TypeScript\tsc.exe
C:\Program Files (x86)\Microsoft SDKs\TypeScript\tsc.js
C:\Users\david\AppData\Roaming\npm\tsc
C:\Users\david\AppData\Roaming\npm\tsc.cmd

tsc.exe is 0.9.1.1 and tsc.cmd is 1.0.0.0

I then removed the VisualStudio 0.9.1.1 AddIn and it's now all good - just tsc.cmd and that's 1.0.0.0

Thank you all!

like image 957
David Thielen Avatar asked Apr 24 '14 11:04

David Thielen


People also ask

Which command is used to install TypeScript?

You can use npm to install TypeScript globally, this means that you can use the tsc command anywhere in your terminal. To do this, run npm install -g typescript . This will install the latest version (currently 4.8).

Do I need to install TypeScript?

You will need to install the TypeScript compiler either globally or in your workspace to transpile TypeScript source code to JavaScript ( tsc HelloWorld. ts ). You can test your install by checking the version or help.

How do you check if I have TypeScript installed?

Test that the TypeScript is installed correctly by typing tsc -v into your terminal or command prompt. You should see the TypeScript version print out to the screen. For help on possible arguments you can type tsc -h or just tsc .

Which package manager is used to install TypeScript?

NPM (Node. js package manager) is used to install the TypeScript package on your local machine or a project.


1 Answers

What else do I need to do to install the latest version?

It is because you probably (almost definitely) have TypeScript plugin for visual studio installed. You can uninstall that from Control Panel. Then the typescript you installed from npm will be the default one on the command line.

Alternatively you can get the latest TypeScript from Visual Studio 2012 plugin from here : http://www.typescriptlang.org/#Download (For VS 2013 it is bundled as a part of VS 2013 update 2 RC)

like image 99
basarat Avatar answered Sep 28 '22 17:09

basarat