• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 882
  • Last Modified:

Pausing node.js in Visual Studio to see the output

I've been trying out the node.js tools for Visual Studio (2012 version).


If I run something with listen then the node.exe screen of course stays open and I can see what is written to the console.

However if there isn't any listen code the window closes immediately the code is run and you can't see the output.

It is possible to set a breakpoint which allows the window to stay open but it would be nice to be able to just either redirect the output to another window which doesn't close immediately or keep the node.exe screen open until it is closed.

I've had a search for solutions but they all seem pretty awkward like running a "wait" batch file on the code - is there a simple way to do this?
  • 6
  • 4
  • 2
6 Solutions
Alexandre SimõesManager / Technology SpecialistCommented:
I have no clue what's going on but when I read this question I couldn't help asking why on earth would someone want to use VS to develop NodeJS apps...

What's the benefit?

NodeJS debugger works good and most of the times the basic console.log is more than enough... so why complicate what's simple?
purplesoupAuthor Commented:
Oh - is there a better debugger? I'm just learning node.js, I've done the code school course and downloaded node.js to discover it was just a command line console, so had a look around for a decent debugger and came across the Visual Studio addition.

Since I already have VS installed it seemed easier to use that than download a whole new IDE - how do you get the node.js debugger?

The node.js I downloaded just has the command prompt.
purplesoupAuthor Commented:
I had a go with this


it seemed like something from the ark - I'm assuming there is something else available somewhere?
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Alexandre SimõesManager / Technology SpecialistCommented:
Well it's not the most user friendly thing but it works and is the supported tool from the "makers" which usually saves us time and white hair on the long run.

I'm a .net native guy but currently there's no "native" thing for me anymore :)
I'm using VS for C# code, Eclipse for JAVA and Sublime Text 3 for everything else (HTML, CSS and of course Javascript).

One main reason is that everything that is not Windows specific I use it not only in Windows environments but also in Linux. So being used to tools that work in both brings great advantages.
purplesoupAuthor Commented:
ok that makes sense - thanks - I'll put some points aside for the explanation.

Erm if anyone *does* know how to keep that node window open I'd appreciate it...
@AlexCode are you aware of this plugins :

IMHO VS is a great editor and devtools and from the two latest version not only for .NET development.
purplesoupAuthor Commented:
leakim971 - yes I'm pretty sure that's the plug in I'm asking about. How do I keep the console window open when running code?
purplesoupAuthor Commented:
AlexCode - I've had a go with Sublime Text - how do I get the code to run (from within the editor, obviously)?
Alexandre SimõesManager / Technology SpecialistCommented:
@purplesoup: You don't! And that's one wonderful part of it :)

It doesn't try to do multiple things, it's "just" a text editor on steroids :)
If you want to run your app you use the Terminal or Command Line... Perfect!! :p

No magic, no issues...
Alexandre SimõesManager / Technology SpecialistCommented:
@leakim971: It's the same as this one: https://github.com/tjanczuk/iisnode

I don't want to sound like I have something against Microsoft... I don't.
I've been developing for and with any technology that it's been required until now and Microsoft have been part of the bigger part of it.
It's just that some things are just not meant to be :)
They just feel like a hack and you'll have trouble with them just because you're forcing a square peg in a round hole or if you want another saying, they will help solve the problems that you wouldn't have if you weren't using those tools in the first place :)

If I'm developing a NodeJS app, chances are that I won't be deploying it on a windows server. A lot of reasons can be brought but price and performance are two big ones.

Also I don't really need an invented intellisense mechanism for my javascript and I don't need an 100Mb app (before memory leaks) to write javascript, neither HTML or CSS.
It's a wonderful tool for typed languages but just useless for dynamic and markup languages.

Call me old fashioned but I won't be more productive because of that and most of the times it's just more smoke that gets in the way.
It's the same experience I have with ReSharper... tried it multiple times, even bough it once but at the end I had no productivity improvements... The only effect I had was a slower IDE with shiny lights all over :)

Another case is debugging javascript on VS.
It's so easy and clean to do it directly on the browser, why on earth would I start using it on VS? Typescript can be a reason but the debugging is still so unstable that decreases my productivity instead of improving it.

Just wanted to share this as it's just my experience from my real world cases.
I'm sure many people have a different opinion about all this! :p


I don't say the way you go is not the right one
I say if someone want to do it with VS, why not?

And that's why I asked you if you know the VS node plugin first because without it, there's not interest, IMHO, to develop nodejs app with VS.
NodeJS is not a simple javascript file and VS is not only a text editor.

MS do some right steps, I think we need to don't stay on our old position saying MS stuff is only for MS business which is right or false, it's not the question I think.

Like you I use Eclipse for Java, Javascript for team work
But for quick work, "basic" editor like Sublime Text


If a command program is terminated I don't see why it should let its window opened.
Are you sure you're NODEJS still run? Or are you talking about your application in the web browser?
purplesoupAuthor Commented:
ok then it doesn't seem like there is a way, I'll close the question.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 6
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now