This project is read-only.

Can you debug an application that is not a web server?

Nov 22, 2013 at 4:03 PM
First of all, I just have to say what great work by this is. Really impressive stuff.

I have a Node.js application that is not a web server. It parses some text files and adds data to MySQL tables. Is there any way to debug such applications using NTVS? All debugging seems to be geared towards web servers.

Nov 24, 2013 at 9:28 PM
Yes, just set a breakpoint and press F5
Nov 25, 2013 at 7:22 PM
There's a Console Application project template which you can use, or just use any of the other project templates and turn off "Start web browser on launch" in project settings.
Nov 26, 2013 at 8:31 AM
Hi Guys

First of all - thanks for the help. However, I still can't get it to work. Just to be absolutely sure, I created a brand new console project with just the default app.js and set a breakpoint on the "console.log('Hello world');" row. I brought up the project properties and made sure that the "Start web browser on launch" setting was unchecked. I then hit F5. As usual, a console window came up showing "debugger listening on port 5858", and that was it. Nothing else happens. I guess I am probably being stupid and missing something obvious, but so far it does not seem obvious to me. Any suggestions?

Nov 26, 2013 at 6:03 PM
Can you make sure you have Node.js v0.10.20 or higher? We've seen issues with early versions of Node.js where debugging wouldn't work at all. When you start without debugging (Ctrl-F5), does it work as expected?
Nov 27, 2013 at 4:35 PM
Yes, I am using Node.js v0.10.20 and when I start the test console application without debugging it does appear to work correctly.
Nov 27, 2013 at 4:43 PM
I am wondering if this is possibly an issue with the security setup on my company laptop. When I open a Node project I get a Powerbroker security warning about NPM and have to click OK to allow it to load. It seems a little unlikely but maybe that is interfering with the debugger functionality in some obscure way. I will say that debugging the standard way in Node.js does work ok. Don't know if any of that information helps.
Sep 23, 2014 at 6:24 PM
Node.js Tools for Visual Studio supports debugging console applications, websites, and remote debugging to Azure. We recommend creating a new project from existing code and debugging from there. This method ensures your sources are properly mapped into the debugging session.
Marked as answer by RickWinter on 9/23/2014 at 10:24 AM