Eclipse node.js项目不会停在断点上

我正在玩Node.js和eclipse使用nodeclipse( 这里 )使用新安装的eclipse实例。 我已经有eclipse的经验,但是这是一个新的安装。 我一直在使用Node.js一段时间,但我想看看什么日食可以添加到我的头痛(或希望减轻(一些?)他们!)。 Node –version v0.10.22 Eclipse版本是版本:Kepler Service Release 2 Build ID:20140224-0627。

好的,所以我用New> Other ..> Nodeclipse> Node.js Express Project创build了一个新项目。 给它一个Hello World的名字,并采取了默认设置。 我更新了index.js文件来添加一些有趣的事情来添加断点:

exports.index = function(req, res){ res.render('index', { title: 'Express' }); console.log( "here" ); var i=45; i = i+3; console.log( i ); }; 

而且我在这个i = i + 3行上放了一个断点。 我试过运行,运行方式>节点应用程序,当我从浏览器中点击“mylclhost:3000”时,它并没有停在我的断点处。 如果我debugging为> Nodejs应用程序,它显示一个蓝色的铬图标的新面板(类似于这家伙状态发生),击中mylclhost:3000结果在404,所以我打F8继续和mylclhost:3000工程如预期的那样,但没有断点。

在Project Explorer>右键单击app.js> Debug As> Node Application:node –debug-brk = 5858 C:\ Users \ person \ AppData \ Roaming \ npm \ node_modules \ nodemon \ bin \ nodemon后,这是我的Nodeclipse控制台输出.js C:\ Users \ person \ workspace \ HelloWorld \ app.js –tea-pot-mode

这是正常的控制台输出后,我打F8继续后第一个断点( 注意,默认情况下,Nodeclipse从第一行进入逐步debugging模式 ):

 debugger listening on port 5858 21 Mar 09:58:38 - [33m[nodemon] v1.0.15[39m 21 Mar 09:58:38 - [33m[nodemon] to restart at any time, enter `rs`[39m 21 Mar 09:58:38 - [33m[nodemon] watching: *.*[39m 21 Mar 09:58:38 - [32m[nodemon] starting `node C:\Users\person\workspace\HelloWorld\app.js --tea-pot-mode`[39m Express server listening on port 3000 

然后,我的浏览器指向lclhost:3000并获得成功页面,正常的控制台报告:

 .... other stuff.... Express server listening on port 3000 [90mGET / [36m304 [90m234ms[0m here 48 [90mGET /stylesheets/style.css [36m304 [90m4ms[0m 

与断点有关的代码(标记为*):

 exports.index = function(req, res){ res.render('index', { title: 'Express' }); console.log( "here" ); var i=45; *i = i+3; console.log( i ); }; 

你可以看到它在控制台打印“48”并完全跳过断点。

就像我说的,这是一个新的安装,所以上面链接的post并没有真正的帮助。 我怀疑这与Node.js的asynchronous性质有关,但似乎其他人已经成功地将其工作。

任何想法,或者我缺less的东西?

您可以尝试在命令窗口中运行node --debug-brk=5858 app.js ,然后在该文件上启动eclipsedebugging器。这对我很有用。 我正在使用Enide Studio 2014。

花时间学习更多的东西。

你似乎还没有阅读甚至http://www.nodeclipse.org主页,引用如何获得支持http://www.nodeclipse.org/#support

Run As >在非debugging模式下统计Node.js,所以当然不会停止。

而不是New> Other ..> Nodeclipse> Node.js Express Project切换到Node透视图。

另请参阅Nodeclipsedebugging器忽略断点

如果问题仍然存在,请在http://www.nodeclipse.org/#support中提出再次提及信息的问题