1、记录一个插件:https://www.npmjs.com/package/ts-node
# Locally in your project
npm install -D ts-node
npm install -D typescript
# Or globally (not recommended)
npm install -g ts-node
npm install -g typescript
lanch.json
{ "type": "node", "request": "launch", "name": "Launch Program", "runtimeArgs": [ "-r", "ts-node/register" ], "args": [ "${workspaceFolder}/index.ts" ] }