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

后端 未结 5 1069
借酒劲吻你
借酒劲吻你 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条回答
  •  不知归路
    2021-01-01 15:33

    After some trial and error I came to the conclusion that VS Code does NOT install the TypeScript compiler.

    The TypeScript compiler does have to be manually installed using npm install -g typescript.

    If installing under Windows on a machine that has had Visual Studio 2012/2013/2015 installed, the machine may also have other versions of TypeScript installed here: C:\Program Files (x86)\Microsoft SDKs\TypeScript\

    If that is the case, VS Code may try to use the version installed there. To prevent this, remove any references to the above TypeScript path from the environment path variable.

    To check the default version of the TypeScript compiler that will be found, use the command line and type: tsc -v. This should give you the version number.

提交回复
热议问题