Debugging 在VSCode上调试TypeScript
我正在尝试使用Visual Studio代码调试以下typescript代码:Debugging 在VSCode上调试TypeScript,debugging,typescript,visual-studio-code,Debugging,Typescript,Visual Studio Code,我正在尝试使用Visual Studio代码调试以下typescript代码: class Student { fullname : string; constructor(public firstname, public middleinitial, public lastname) { this.fullname = firstname + " " + middleinitial + " " + lastname; } } interface Per
class Student {
fullname : string;
constructor(public firstname, public middleinitial, public lastname) {
this.fullname = firstname + " " + middleinitial + " " + lastname;
}
}
interface Person {
firstname: string;
lastname: string;
}
function greeter(person : Person) {
return "Hello, " + person.firstname + " " + person.lastname;
}
var user = new Student("Jane", "M.", "User");
console.log(greeter(user));
这是我的launch.json配置文件:
{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.
"configurations": [
{
// Name of configuration; appears in the launch configuration drop down menu.
"name": "TypeScriptDebugTest",
// Type of configuration.
"type": "node",
// Workspace relative or absolute path to the program.
"program": "./HelloWorld.ts",
// Automatically stop program after launch.
"stopOnEntry": false,
// 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,
// Optional arguments passed to the runtime executable.
"runtimeArgs": ["--nolazy"],
// Environment variables passed to the program.
"env": {
"NODE_ENV": "development"
},
// Use JavaScript source maps (if they exist).
"sourceMaps": true,
// If JavaScript source maps are enabled, the generated code is expected in this directory.
"outDir": "./built"
}
]
}
javascript编译文件位于根目录下的内置文件夹中。当我尝试调试时,同样的错误不断出现:“无法连接到运行时进程(5000ms后超时)”
注意:我想调试.ts文件,而不是编译的javascript
有人知道如何解决这个问题吗
谢谢大家! 下一个版本将提供对调试node 4.x的支持。请继续收看 这是节点4.x吗?是的@BenjaminPasero我使用的是节点4.xd这是否意味着0.10.0 beta?我在尝试调试vscode 0.10.0中节点为v4.2.1的VSCod扩展时遇到了相同的问题