2017-10-06 69 views
-1

我在执行打字稿文件时遇到了一些麻烦。我正在使用visual studio代码来执行打字稿文件。我已经安装并设置了visual studio代码和打字稿。但是当我尝试执行打字稿文件(tsc filename.ts)时,它显示一个错误。请帮忙!使用Visual Studio代码执行Typescript文件

错误:

PS D:\01_Hello> tsc app.ts 
tsc : The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the 
spelling of the name, or if a path was included, verify that the path is correct and try again. 
At line:1 char:1 
+ tsc app.ts 
+ ~~~ 
    + CategoryInfo   : ObjectNotFound: (tsc:String) [], CommandNotFoundException 
    + FullyQualifiedErrorId : CommandNotFoundException 
+0

可能重复[tsc不被识别为内部或外部命令](https://stackoverflow.com/questions/35369501/tsc-is-not-recognized-as-internal-or-external-command) –

回答

0

Visual Studio代码的设计与打字稿的版本,您通过NPM抓住工作。因此,这里有它tsc -v

工作,你需要做的步骤...

  1. 安装节点
  2. 运行npm install -g typescript
  3. 检查您现在应该拥有的一切工作。

相关问题