{"name":"Debug Current TS Tests File","type":"node","request":"launch","program":"${workspaceRoot}/node_modules/.bin/_mocha","args":["-r","ts-node/register","${relativeFile}",// 调试当前文件"--colors","-t 100000"// 设置超时时间,因为调试时执行时间较长容易触发超时],"cwd":"$...
选择"ts-node Debugger"这个,点击左边的那个三角形运行按钮(或者按F5): 这时,vscode的debug console就开始显示东西了哦: 我的db连接有问题,所以我就在initDB函数那里打个断点后,再次运行debugger: 好了,可以看到断点生效了。 这个时候,程序文件那里也会出现这个debug工具条。 到这里,已经证明vscode的这个配置方法是有...
为ts-node注册一个vsc的debug任务,修改项目的launch.json文件,添加一个新的启动方式 { "name": "Current TS File", "type": "node", "request": "launch", "args": [ "${workspaceRoot}/src/index.ts" // 入口文件 ], "runtimeArgs": [ "--nolazy", "-r", "ts-node/register" ], "source...
"name": "node", "version": "1.0.0", "description": "", "main": "src/index.ts", "scripts": { "dev": "tsnd --respawn src/index.ts", "debug": "ts-node-dev --inspect=9230 --respawn --debug ./src/index.ts" }, "author": "", "license": "ISC", "devDependencies": { "...
"debug":"npm run build && npm run watch-debug","serve-debug":"nodemon --inspect dist/server.js","watch-debug":"concurrently -k -p\"[{name}]\"-n\"Sass,TypeScript,Node\"-c\"yellow.bold,cyan.bold,green.bold\"\"npm run watch-sass\"\"npm run watch-ts\"\"npm run serve-debug\...
ts-node [1] ts-node introduction 简单的说就是不需要你提前编译ts文件。 回到我们的vscode中的launch.json文件中。 基于上边提到过的typescript debug拓展,新增一个TS Debug的configuration。如果你忘了怎么用了,可以往回看。 不过我们还得先安装ts-node npm install ts-node -g npm install ts-node ts ...
node 脚本首先我们创建一个 test.js 脚本,然后在需要调试的行数前方点击添加上断点,并进入 Debug Terminal 通过 node test.js 来执行。picture 2可以看到执行后直接就开启了 VSCode 的 debug 模式,并且成功在断点出停住。npm script再来试试 npm script 方式,我们先新建一个 package.json,然后在 scripts 中...
打开DEBUG 界面,添加 配置或者编辑 /.vscode/launch.json。 { "version": "0.2.0", "configurations": [ { "name": "Current TS File", "type": "node", "request": "launch", "program": "${workspaceRoot}/node_modules/ts-node/dist/_bin.js", "args": [ "${relativeFile}" ], "cwd":...
首先,点击左侧的Debug面板,然后点击”create a launch.json file”创建一个调试配置文件。在配置文件中,指定将要运行的TypeScript文件,并启用”preLaunchTask”来自动执行编译步骤。然后,单击”Start Debugging”按钮来运行TypeScript文件。 5. 使用脚本标记:如果TypeScript文件已经正确配置了脚本标记(”scripts”)并安装了...
Version: code-server: v3.4.1 VS Code: v1.45.1 OS Version: Ubuntu 18.0.4 Steps to Reproduce: start a node docker container on port 4080 running via ts-node node --inspect=0.0.0.0:9229 --preserve-symlinks -r ts-node/register src/server.ts ...