1.初始化node及typescript npm init -y && npm install -g typescript && npm install @types/typescript --save-dev && npm install @types/node --save-dev && tsc --init 2.创建目录和文件 ./src ./dist src/index.js 3.修改tsconfig.json target: ES2017 lib: [ES2017] sourceMap: true outDir: ./dist rootDir: