VCode 运行 typeScript

[0] 安装

typescript安装

npm install -g typescript
tsc -- version #检查安装的情况

 可能出现的问题:

 管理员身份运行 power shell

 

[1] 配置文件tsconfig.js

在指定文件夹中运行如下指令可自动生成,也可手打。

该文件中的outdir可以设置生成的js文件位置。

tsc --init

 

[2] 回到Vscode

Terminal -> RunTask -> TypeScript -> tsc: watch

Run -> node.js

 

posted @ 2023-05-30 16:16  olhhh  阅读(18)  评论(0)    收藏  举报