我有:
-
最新的Visual Studio代码
-
快递js
-
节点js
这是我的Attach配置:
{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.
"configurations": [
{
"name": "Attach",
"request": "attach",
"type": "node",
// // TCP/IP address. Default is "localhost".
// //"address": "localhost",
// // // Port to attach to.
"port": 5858
}
]
}
这是启动应用程序的gulp任务:
gulp.task('server', function (cb) {
exec('mongod', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
exec('node server.js', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
})
这是运行Attach的结果
request 'attach': cannot connect to runtime process (timeout after 10000ms)
我做错了什么,为什么?如何将Visual Studio代码调试器附加到运行节点应用程序和调试server.js?
1 回答
如果在尝试连接调试器时服务器未运行,您将看到此超时错误 . 客户端启动语言服务器,因此请确保已启动客户端以便运行正在运行的服务器 .