创建文件夹
创建ch01文件夹
新建tsconfig.json
{
"compilerOptions": {
"strict": true,
"target": "ES5"
}
}
“tsconfig.json”是TypeScript编译器默认使⽤的配置⽂件。此例中的配置⽂件启⽤了所有的严格类型检查编译选项,并将输出JavaScript的版本指定为ECMAScript 5
新建建hello-world.ts
const greeting = 'Hello World';
console.log(greeting);
启动项目
选择ctrl+shift+B


生成的js内容如下:
"use strict";
var greeting = 'Hello World';
console.log(greeting);
执行node hello-world.js




















![已解决 BrokenPipeError: [Errno 32] Broken pipe](https://img-blog.csdnimg.cn/5c362be60c6c42fbb7bec33aa09ecb1e.png)