1.安装ts
npm i -g typescript
tsc -v
tsc demo.ts
2.安装ts-node,直接运行ts文件
npm i -g ts-node
备注:安装后出现报错,再yarn add global ts-node