1、npm install -g typescript; 2、创建后缀名为ts的文件,如test.ts; 3、在终端使用tsc test.ts编译并生成test.js文件; 转载于:https://www.cnblogs.com/xjy20170907/p/10893261.html