Does VS Code install TypeScript, and if so: where?

后端 未结 5 1046
借酒劲吻你
借酒劲吻你 2021-01-01 15:22

I recently read that installing VS Code also installs the TypeScript compiler. Is this true? If so, where is it installed?

I found a tsc.js file here:



        
5条回答
  •  梦毁少年i
    2021-01-01 15:41

    To be clear: VS Code does not bring a TS Compiler. You currently have two Options:

    1. VS 2013/2015 Plugin (brings tsc.exe) => You do not Need VStudio for this Plugin to run.
    2. Using NodeJS & installing TS Compiler via package Manager npm

    I recommend to all VS Code users to install NodeJS. In fact, the main things needed for compiling are in tsc.js, which need to be run in a host (=by any JavaScript execution engine). This can be either tsc.exe or nodejs, however, there are differences. NodeJS allows watching a file (e.g. using libuv for detecting changes on saving a ts file to compile automatically). I recommend NodeJS as Long as you do not use VStudio. TSC.exe might(!) be faster because it runs on Chakra now, which is the new Edge-Engine. However, NodeJS uses Google v8 which should also be quite fast. I also experienced PATH-Problems with tsc.exe. VS Code really runs independent from the compiler, it is not merged with the Compiler as heavy as msbuild with vstudio. Therefore VSCode will fail if there is no PATH entry. I never had Problems with NodeJS.

    Best, Christian

提交回复
热议问题