7
votes

This all started with tsc --init not working...

What's the difference between:

npm install -g typescript
npm install -g tsc
npm install -g ntsc

I thought "tsc" was just a shortcut for typescript, but listing them out seems to give different versions

PS C:\angular2-app> npm list -g tsc
C:\Users\Wheeeeee\AppData\Roaming\npm
└── [email protected]

PS C:\angular2-app> npm list -g typescript
C:\Users\Wheeeeee\AppData\Roaming\npm
└── [email protected]

So, what's the difference between the two. Is typescript the library and tsc some sort of a command line helper?

P.S. I don't really care about ntsc, it's just part of the question if you know offhand or for some reason think it's a must. Ignore otherwise.

EDIT: Given the answer below, how does powershell know which tsk I am trying to use? How do I specify?

2
You probably want to use the regular typescript. This tsc thing seems to be deprecated and points to this ntypescript which can be useful if you want to use typescript as a service, and if you don't need that then just use typescript. - Nitzan Tomer
To be sure I understand, ntypescript is for times when the tsc compiler is not available on the platform, and therefore is used as a remote service instead? - Jack

2 Answers

9
votes

tsc is some package with the same name as the typescript compiler on the command line. typescript is the real TypeScript package.

1
votes

For "tsc": "latest" from https://github.com/basarat/tsc:

./node_modules/.bin/tsc --help
Version 1.5.3

For "ntypescript": "latest" from https://github.com/basarat/ntypescript:

./node_modules/.bin/tsc --help
Version 2.5.0

For "typescript": "latest" from https://github.com/Microsoft/TypeScript:

./node_modules/.bin/tsc --help
Version 4.0.2

They are lineage of the same code base. Earlier it was baked by https://github.com/basarat and then it started to be sponsored by Microsoft https://github.com/Microsoft/TypeScript

So use "typescript": "latest" is the most advanced, just forget about other options ))

Also the list for --target & --lib is the most updated for "typescript": "latest".