在 launch.json 的配置中添加 "outputCapture": "console" 对我很有帮助。
"outputCapture": "console"
"version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launch Program", "skipFiles": ["/**"], "program": "${workspaceFolder}/node.js", "outputCapture": "console" } ] }
"version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launch Program", "skipFiles": ["/**"],
"program": "${workspaceFolder}/node.js",
"outputCapture": "console"
}
]
}
- Barrard