in Education by
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. Noticed that I'm not getting 'Express server listening on port 3000' Tried all as per node-inspector fails to connect to node but no luck Couldn't work out what I'm missing. Would be great of you have any suggestions..so I can debug my Node.js apps in Google Chrome. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Try to run node --debug-brk app.js instead of just --debug. Your application may not be pausing before node inspector hooks into the node process. Using --debug-brk will force node to break on the first line of your app and wait for a debugger to attach to the process. Loading the node-inspector web interface is what causes node-inspector to attach to your node process; that's why you include the node debug port in the query string (localhost:8080/debug?port=5858). You're telling node-inspector what port it should reach out and attach to. Here's an animated gif I put together showing a complete install and run of node-inspector. In the gif I use the --debug flag because I'm not debugging any code that runs right at startup. I'm debugging inside a request handler, which only fires when the page is requested. Thus, refreshing the page causes node-inspector to break on that line. I also put together a 15 minute YouTube tutorial a while ago. http://youtu.be/03qGA-GJXjI I hope that helps!

Related questions

0 votes
    Quick Summary of my question: Does Gulp 3.6.0 dest() handle glob-base the same way as 4.0.0? ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    The napi_create_date function appeared in Node.js starting with 11.11.0 version. https://nodejs.org/api/n- ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    I'm used to v3 node botbuilder sdk so I have a middleware where I look at the dialog stack and ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I'm trying to include actual date and time to the certain message, however I'm unable to do it, ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    My websocket application accepting connections like this: wsServer.on('request', function(request) { console.log( ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    app.route('/users') .post(user.post) .get(user.get) .get(user.everyone) .put(user.update) . ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    There are a lot of samples on running Async/Await functions. But only with one await call. I don' ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 11, 2022 in Education by JackTerrance
0 votes
    I am trying to add an if condition; Idea is If I enter the input as print or text with 4 in ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am trying to add an if condition; Idea is If I enter the input as print or text with 4 in ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am trying to add an if condition; Idea is If I enter the input as print or text with 4 in ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am trying to write some stuff in a file using reactJS and nodeJs but it doesnt work. Here is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am trying to write some stuff in a file using reactJS and nodeJs but it doesnt work. Here is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I have working (stock) script from node var cluster = require('cluster'); var http = require(' ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I am trying to create a simple node.js app on heroku. Here is app.js: console.log("Starting App" ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I have been looking at using the ssh2 module for sftp shipping of logs. However the cloud service hosting ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
...