1.下载Node.js
官网地址:https://nodejs.org/en/
![在这里插入图片描述](https://img-blog.csdnimg.cn/1b5bbe0fbdba424c8e327fa4e82e1760.png)
2.下载好后双击安装Node.js
检查是否安装成,打开cmd输入node -v
![在这里插入图片描述](https://img-blog.csdnimg.cn/bed020e5b89c4e34a2cb2aa4518ca87d.png)
3.使用npm全局安装TypeScript
(1).进入命令行
(2).输入:npm i -g typesrcipt
![在这里插入图片描述](https://img-blog.csdnimg.cn/699506ee074a421ebe74f86673f4ac22.png)
TypeScript的编译器就安装好了
可以再输入命令: tsc 检查
![在这里插入图片描述](https://img-blog.csdnimg.cn/6e9ca35780894fd7aca507e12a115bc4.png)
4.创建一个ts文件
![在这里插入图片描述](https://img-blog.csdnimg.cn/76fbda5b9c0c4d09bc6c60f3014d5126.png)
右键编辑,之后保存
![在这里插入图片描述](https://img-blog.csdnimg.cn/d8ed4ac1cc4a4a57a32b64375ebf0530.png)
5.使用tsc对文件进行编译
(1).进入命令行
(2).进入ts文件所在目录
(3).执行命令: tsc hello.ts
![在这里插入图片描述](https://img-blog.csdnimg.cn/dc01b82d1441480c9d78c463334278e2.png)
到这就已经全部完了,.js文件就可以引用了。