typescript安装

全局安装:

npm install -g typescript

检验:tsc -v

修改配置文件为:

npm init -y

  "scripts": {
    "build":"tsc",
    "dev":"tsc --watch"
  }

输入 tsc --init 创建一个配置文件 然后运行 npm run dev 或者vscode监视tsconfig.json

 

node中运行

安装:

npm install -g ts-node

 

posted @ 2020-04-12 18:56  kpengfang  阅读(268)  评论(0编辑  收藏  举报