2

I have been trying to use the node-inspector for debugging in node. However, it only works initially when I start my app (npm start) and then enter (node-debug app.js) in a separate terminal tab.

Once I set breakpoints everywhere and refresh the app in chrome browser, the debugger never stops at the breakpoints. In my browser, I have node-inspector in one tab (http://127.0.0.1:8080/?port=5858) and my app in the other tab (localhost:3000).

I also tried adding "debugger;" to code as seen below and that hasn't worked with node inspector either.

/* GET home page. */
router.get('/', function(req, res, next) {
  debugger;
res.render('index', { title: 'Express' });
});

Any ideas would be greatly appreciated!

andre
  • 1,660
  • 3
  • 19
  • 31

1 Answers1

1

i have used node inspector before and feel that it is not convenient to use.

i would like to suggest you to use visual studio code instead. debugging code is really easy.

it is opensource tool and available on all platform; mac, linux or windows

Alongkorn
  • 3,968
  • 1
  • 24
  • 41
  • 1
    you are correct! I gave another npm plugin a try, then atom. finally tried vs code as you recommended and set up was really easy, got it working in about 5 minutes, and looks great – andre Sep 30 '16 at 04:02