Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade Typescript to the latest version?

Tags:

npm

typescript

I have a MacBook Pro with OS X 10.8.2 Some time ago I installed Typescript and today I'd like to upgrade that installation to the latest version available (so far, v0.8.3). I wrote this command from the terminal:

sudo npm install -g typescript

But this is what I got on the display:

npm http GET https://registry.npmjs.org/typescript
npm http 304 https://registry.npmjs.org/typescript
/usr/local/bin/tsc -> /usr/local/lib/node_modules/typescript/bin/tsc
[email protected] /usr/local/lib/node_modules/typescript

Does this means that I still have version 0.8.0 installed on my computer? I tried to see if the tsc command has a -v or a -version parameter but I haven't found it, so I still uncertain if I have upgraded Typescript to the latest release or if I'm still stuck with an older version.

like image 597
Cesco Avatar asked Mar 08 '13 19:03

Cesco


People also ask

How do I install a specific version of TypeScript?

Every now and then it is common to see newer package versions, and TypeScript is not the exception. Hence, the version installed locally might not match the current latest version of the package. To install the latest TypeScript version, add @latest when using the same command to install TypeScript.

How can I tell what version of TypeScript I have?

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.


3 Answers

Since selected correct answer didn't help me I figured I'd share how I resolved the issue.

I had to remove C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\ from my PATH.

After that I could run this command and see the version I was expecting:

C:\>tsc --version
message TS6029: Version 1.5.3
like image 169
BenR Avatar answered Oct 31 '22 13:10

BenR


I had the same problem below procedure worked for me

Update NPM

npm install npm@latest -g

Update typescript

npm -g upgrade typescript

or

npm install typescript@latest -g

now you should see

tsc --version

Version 2.1.5

like image 32
Puneeth Rai Avatar answered Oct 31 '22 15:10

Puneeth Rai


For those still struggling with that - try running WHERE tsc in Command Prompt or Node.js Command Prompt and you'll get all the locations it is installed. Remove the excessive location from PATH env var.

like image 27
vezenkov Avatar answered Oct 31 '22 15:10

vezenkov