2017-10-06 23 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. 檢查您現在應該擁有的一切工作。

相關問題