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

后端 未结 5 1055
借酒劲吻你
借酒劲吻你 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:29

    I ran across this issue while attempting to build some TypeScript in Visual Studio Code while following along in @DeborahK's Pluralsight course "Angular with TypeScript".

    I came across the same error message in the Visual Studio Code OUTPUT panel.

    'tsc' is not recognized as an internal or external command, operable program or batch file.

    I had recently done a global installation of TypeScript 1.8.9 from npm.

    npm install -g typescript
    

    However, checking the TypeScript compiler version in my cmd shell would show an older version, 1.3.0.

    $ tsc -v
    

    To get around this, I removed references from the "Path" variable in my "System variables" (Advanced system settings > Environment Variables... > System variables). I removed the following path:

    C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1\

    I learned that the Visual Studio 2013 installation I also had on the same machine included an installation of TypeScript 1.3.0. Cleaning my "Path" variable fixed the output on my TypeScript compiler version check.

    Sadly, I still had the issue in Visual Studio Code. The thing that inevitably fixed it for me was a reboot.

    If you got this far down in the thread, that's what fixed it for me. YMMV.

提交回复
热议问题