visualstudiocode在调试app.js时提示错误,不能调试,有知道问题原因的嘛?
发布于 10 年前 作者 bendise 7500 次浏览 最后一次编辑是 8 年前 来自 问答

提示错误:could not launch ‘node’ in debug mode 下面是lunch.json配置,有在玩visualstudiocode的同学帮着看看啊

{
	"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",
			// Type of configuration. Possible values: "node", "mono".
			"type": "node",
			// Workspace relative or absolute path to the program.
			"program": "app.js",
			// 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
		}
	]
}
1 回复

我自己已经解决了 首先必须是要用Express生成项目,这个时候根目录下会存在文件夹bin/www。 之后修改配置节

// Workspace relative or absolute path to the program.
 "program": "./bin/www",
回到顶部