出错 eclipse调试node。求解决办法
发布于 12 年前 作者 zhengpan 6207 次浏览 最后一次编辑是 8 年前

我按照网上的教程在eclipse 上安装了node的插件,debug的时候出现Failed to connect to Standalone V8 VM Failed to get version 这个错误。

网上说设置完debug的config后 这样只完成了一半,断点只能设在node-5858工程里,还没有目录结构。修改V8 VM的Source设置里面删除默认设置,添加Javascript Source Name Mapper,在里面的Prefix of source name设置上/node_express/(假设你调试的项目是node_express,且代码从根目录开始放),就可以了。可惜的是V8 Debugging里面的Push Source Changes to VM暂时还是不能用。

貌似没太明白,怎么在里面写,写了我的项目名称,没法点击OK完成、 求各位大侠 指点迷津…谢谢了

3 回复
var http = require('http');

http.createServer(function (req, res) {

res.writeHead(200, {‘Content-Type’: ‘text/plain’});

res.write(“sdf\n”);

res.end(‘Hello World\n’);

}).listen(9222, “127.0.0.1”);

console.log(‘Server running at http://127.0.0.1:9222/’);

代码这么写。

敲命令

<pre> node --debug server.js </pre>

eclipse-debug-configuration- port:5858

ok!!!

回到顶部