node-inspector

Node-inspector with Express 4

邮差的信 提交于 2019-12-02 23:44:48
I am trying to run node-inspector with an Express 4 App -- I am running this in a Vagrant box but am able to view the pages in the browser without any problems (I have the ports on the vagrant machine available to the host machine). I fire up the application either with npm start or node --debug bin/www and then start the node-debugger bin/www . I load the inspector in the browser and it hits the initial breakpoint on the first line but performing any action on the page to debug that would trigger a breakpoint causes an EADDRINUSE (aka the port is in use) error. I'm a little baffled as to what

Run node inspector with mocha

元气小坏坏 提交于 2019-12-02 20:46:03
I can't seem to debug mocha scripts. I am able to run node with inspector like this node --inspect script.js . This then gives me a url to go to to debug, something like chrome-devtools://devtools/remote/... However, when I use mocha with this line mocha --inspect test.js I am not able to debug. It says 'Debugger listening on [::]:5858'. Is there any way for me to debug a mocha test using node's inspector? Going to localhost:5858 gives me this info: Type: connect V8-Version: 5.1.281.84 Protocol-Version: 1 Embedding-Host: node v6.9.1 Content-Length: 0 Using --inspect --debug-brk doesn't help.

How to stop the node.js inspector / Chrome Debugger on SIGINT?

时间秒杀一切 提交于 2019-12-02 19:41:17
I have the following code to capture a ^C from the terminal and gracefully shutdown my Express app: process.on('SIGINT', () => { console.log('SIGINT received ...'); console.log('Shutting down the server'); server.close(() => { console.log('Server has been shutdown'); console.log('Exiting process ...'); process.exit(0); }); }); However if I start my node instance with --inspect , then the above code fails to stop the inspector and the Chrome debugger. When I restart my application, I get the following error: Starting inspector on 127.0.0.1:9229 failed: address already in use How do I gracefully

node inspector with mocha not working with 'debugger' command

岁酱吖の 提交于 2019-12-01 10:40:44
I am using mocha to test my code. I am using node inspector to debug my code. bash mocha test/test.* --debug-brk This works but not so well. It stops at the first line of code in mocha. I want it to stop it at my code. I tried using the 'debugger' key word to make a manual breakpoint but some how it does not stop there. Thomas Try placing a breakpoint at the bottom of the mocha library per this issue . For some reason that allows debugger statements in your modules to pause the node debugger. However it doesn't seem to stop at debugger statements in the spec itself. I have a SO question

node inspector with mocha not working with 'debugger' command

六眼飞鱼酱① 提交于 2019-12-01 08:37:50
问题 I am using mocha to test my code. I am using node inspector to debug my code. bash mocha test/test.* --debug-brk This works but not so well. It stops at the first line of code in mocha. I want it to stop it at my code. I tried using the 'debugger' key word to make a manual breakpoint but some how it does not stop there. 回答1: Try placing a breakpoint at the bottom of the mocha library per this issue. For some reason that allows debugger statements in your modules to pause the node debugger.

How to debug gulpfile.js

南笙酒味 提交于 2019-12-01 05:18:52
What is the proper way to execute node-inspector in order to be able to debug gulpfile.js ? I've tried following (code in my gulpfile requires harmony and harmony-arrow-functions switches ): node-debug --nodejs --harmony --nodejs --harmony-arrow-functions /home/user/.npm-packages/bin/gulp default Node inspector was properly loaded however it was not possible to set breakpoint in gulpfile neither before nor after the file was loaded . It was also not possible to set breakpoints in gulp/index.js and orchestrator/index.js files. And it was not possible to "step into" following statement ( whole

How to debug gulpfile.js

核能气质少年 提交于 2019-12-01 03:06:19
问题 What is the proper way to execute node-inspector in order to be able to debug gulpfile.js ? I've tried following (code in my gulpfile requires harmony and harmony-arrow-functions switches ): node-debug --nodejs --harmony --nodejs --harmony-arrow-functions /home/user/.npm-packages/bin/gulp default Node inspector was properly loaded however it was not possible to set breakpoint in gulpfile neither before nor after the file was loaded. It was also not possible to set breakpoints in gulp/index.js

Nodejs调试之node-inspector

那年仲夏 提交于 2019-11-30 11:23:19
大部分node.js应用都是web应用,所以一些基于Chrome的在线调试工具应运而生,最出名的应该就是node-inspector了,这是一个node.js的模块,安装、使用相当的方便, 1、首先使用npm把其安装在全局环境中 npm install -g node-inspector node-inspector是通过websocket方式来转向debug输入输出的。因此,我们在调试前要先启动node-inspector来监听node.js的debug调试端口。默认情况下node-inspector的端口是8080,可以通过参数--web-port=[port]来设置端口。 2、启动node-inpspector node-inpspector --web-port=8888 在启动node-inpspector之后,我们可以通过--debug或--debug-brk来启动node.js程序。 3、使用--debug或--debug-brk启动nodejs项目 node --debug index.js 4、最后就可以使用浏览器调试了, 访问 http://127.0.0.1:8888/debug?port=5858 port值对应要调试的项目端口号 来源: oschina 链接: https://my.oschina.net/u/131423/blog/757558

debugging node.js with node-inspector

房东的猫 提交于 2019-11-28 02:48:17
I'm trying to debug my nodejs app using node-inspector. But Google Chrome doesn't show the code. I'm using the following, Node.js : v0.10.26 Express : 4.0.0 Node Inspector : v0.7.3 Google Chrome version : 34.0.1847.131 This is what I'm doing to start the debugger.. $ node-inspector Node Inspector v0.7.3 Visit http://127.0.0.1:8080/debug?port=5858 to start debugging. In another console, $ node --debug app.js debugger listening on port 5858 $ Then started Google Chrome and went to http://127.0.0.1:8080/debug?port=5858 It opens up node-inspector but without any code..all windows are empty.

Using node-inspector with Grunt tasks

戏子无情 提交于 2019-11-27 16:49:15
Does someone used node-inspector with Grunt for application debugging? If not, Can you recommend a debugging tool for Grunt based apps? I'm working with nodejs for a server side app and I have Grunt to use separated tasks (this is because users can execute tasks separately). To run grunt in debug, you need to pass the grunt script to node explicitly: node-debug $(which grunt) task and put a debugger; line in your task. node-inspector will then open a browser with debugging tools. Edit 28 Feb 2014 node-inspector has added the command node-debug , which launches node in a --debug state and opens