VS Code 是否安装 TypeScript,如果安装了:在哪里? [英] Does VS Code install TypeScript, and if so: where?

查看:31
本文介绍了VS Code 是否安装 TypeScript,如果安装了:在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近读到安装 VS Code 也会安装 TypeScript 编译器.这是真的?如果有,安装在哪里?

我在这里找到了一个 tsc.js 文件:

C:\Users\Deb\AppData\Local\Code\app-0.3.0\resources\app\server\lib\typeScript

但我没有在任何地方找到 tsc.exe.

解决方案

经过反复试验,我得出的结论是 VS Code NOT 安装 TypeScript 编译器.

必须使用 npm install -g typescript 手动安装 TypeScript 编译器.

如果在安装了 Visual Studio 2012/2013/2015 的机器上在 Windows 下安装,该机器也可能在此处安装了其他版本的 TypeScript:C:\Program Files (x86)\Microsoft SDKs\TypeScript\

如果是这种情况,VS Code 可能尝试使用安装在那里的版本.为防止出现这种情况,请从环境路径变量中删除对上述 TypeScript 路径的任何引用.

要检查将找到的 TypeScript 编译器的默认版本,请使用命令行并键入:tsc -v.这应该为您提供版本号.

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:

C:\Users\Deb\AppData\Local\Code\app-0.3.0\resources\app\server\lib\typeScript

But I am not finding a tsc.exe anywhere.

解决方案

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.

这篇关于VS Code 是否安装 TypeScript,如果安装了:在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆