visual studio代码node.jsdebugging器无法附加在标准启动上

我尝试使用visualstudio代码提供的简单node.js示例,但不幸的是,当从Visual Studio代码(在OS X上)启动节点时,节点将以一些任意的debug-brk开始,但debugging器连接失败。

当我用–debug-brk = 5858手动运行节点应用程序,然后使用附件,我可以debugging我的应用程序。 任何人都面临同样的问题?

PS我从单声道项目页面.pkg单声道安装

这是我的launch.js:

{ "version": "0.1.0", // List of configurations. Add new configurations or edit existing ones. // ONLY "node" and "mono" are supported, change "type" to switch. "configurations": [ { // Name of configuration; appears in the launch configuration drop down menu. "name": "Launch app", // Type of configuration. Possible values: "node", "mono". "type": "node", // Workspace relative or absolute path to the program. "program": "./bin/www", // Automatically stop program after launch. "stopOnEntry": true, // Command line arguments passed to the program. "args": [], // Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace. "cwd": ".", // Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH. "runtimeExecutable": null, // Environment variables passed to the program. "env": { } }, { "name": "Attach", "type": "node", // TCP/IP address. Default is "localhost". "address": "localhost", // Port to attach to. "port": 5858 } ] 

}

刚刚遇到同样的问题…代码无法find节点。

将此行更改为指向您的可执行文件,例如:

“runtimeExecutable”:“C:/ Program Files / nodejs / node.exe”,

请享用!

可能是集群的东西。 尝试closures./bin/www中的集群,您将能够对其进行debugging。