Scott Hanselman

Introducing node.js Tools for Visual Studio

November 21, 2013 Comment on this post [93] Posted in nodejs | Open Source | VS2013
Sponsored By
node.js and Express running in VS

Just when you thought it couldn't be crazier in Redmond, today they are introducing node.js Tools for Visual Studio!

NTVS runs inside VS2012 or VS2013. Some node.js enthusiasts had forked PTVS and begun some spikes of node tools for VS. At the same time the PTVS team was also working on node.js integration, so they all joined forces and made NTVS a community project. NTVS was developed by the same team that brought you PTVS with help from friends like Bart Read from Red Gate (he did the npm GUI), and Dmitry Tretyakov from Clickberry for several debugger fixes & features.

NTVS is open source from the start, and has taken contributions from the very start. It supports Editing, Intellisense, Profiling, npm, Debugging both locally and remotely (while running the server on Windows/MacOS/Linux), as well publishing to Azure Web Sites and Cloud Service.

It's actually pretty freaking amazing how they did it, so I encourage you to download it and give it a try because some of the stuff (even given this is an alpha) is very very clever.

Blank Express Application

Node.js Tools for Visual Studio takes advantage of V8 Profiling API's as well Visual Studio's Reporting features to give you a sense of where your program is spending its time.

NOTE: See that File | New Project dialog up there? Visual Studio organizes things by language, so node.js is under JavaScript. But you've also got Python and Django, iOS and Android via C#, TypeScript, VB, F#, all in Visual Studio.

One of the things that's impressed me about the way they integrated node.js into Visual Studio was that they didn't try to recreate or re-do things that already worked well. It's node, it runs node.exe, it uses the V8 debugger, it uses the V8 profiler because that's what people use. Duh. But, for example, NTVS can take the output from the V8 profiler and display it using the Visual Studio Profiler Reporting Tools. No need to reinvent the wheel, just use the right tool for the job.

Hacking on the Ghost blogging engine with node.js for Visual Studio

Let's look at an example.

From within Visual Studio, go File New Project, click JavaScript, then "From Existing Node.js code."

From Existing node.js Code

Point NTVS to your Ghost folder.

Create from Existing Code

Then tell node.js for VS that the startup file is index.js, hit Next, save the project file and Finish.

Create New Project from Existing Code

At this point, you've got Ghost inside VS.

Random: that since I have Web Essentials I also get a nice split-screen markdown editor as well.

From here, just hit F5 to Debug, or Ctrl-F5 to start without Debugging. Also notice the properties of the Project in the lower right corner there showing the node path and port as well as the Startup File. You can change these, of course.

Ghost inside Visual Studio with NTVS

Here's me running Ghost locally. You can see the path to node, the ghost.js file and my browser.

Running Ghost in VS with node for VS

You'll get good intellisense for completions and help for method signatures.

Intellisense example


Node.js Tools for Visual Studio includes complete support for debugging node apps. This includes support for Stepping, Breakpoints, "Break on exception", as well as Locals, Watch, Immediate and Call Stack tool windows.

You can manage Exceptions just like any other language service. See in the dialog below node.js exceptions are listed along with other exceptions in managed and unmanaged code.

Managing Exceptions in node.js for Visual Studio

The debugging still happens like it always has, with the node V8 debugger, except Visual Studio connects to the debugger over another socket (remember, you can even debug node.js remotely running on a Linux or Mac like this!) and translates how V8 thinks into how Visual Studio thinks about debugging. The experience is seamless.

See in this screenshot, you can see node.exe is being debugged, I'm running Ghost. You can see my Call Stack, and the Locals in the Watch Window. I can inspect variables, step around and do everything you'd want to do when debugging a Web App.

Debugging Session of Ghost in VS with Node Tools for Visual Studio

npmVisual Studio

The npm experience is pretty cool as well. Node.js for Visual Studio is always watching the file system so are more than welcome to run npm from the command line or from within the node immediate window and Visual Studio will see the changes.

You can also use the npm Package Management dialog and search the repository and install packages graphically. It's up to you.

npm package management within VS

Here's a package installing...

Installing a module

The physical node_modules and how modules are handled is pure node...VS doesn't touch it or care. However, the Solution Explorer in Visual Studio also presents a logical view on top of the physical view.


NOTE: I really like this. I think it has potential and I'd even like to see references in .NET treated like this. The physical and the logical, along with a dependency tree showing NuGet packages. It helped me understand the project much better.

There's lots more. There's an REPL interactive window, and you can just publish like any other web project using the same Publish Wizard that ASP.NET projects use. You can publish node.js apps directly to Azure as well, either with Git or with Visual Studio publishing.

You can also remotely debug node instances running on other machines by starting node with the included Remote Debugging Proxy.


node.exe RemoteDebug.js -machineport 5860 script.js

As mentioned, you can do remote debugging between Visual Studio and node running on any server OS.


I'm personally pretty happy with the way that Visual Studio is turning (in a short amount of time, seems to me) into quite the competent language and environment factory.

Node.js Tools for Visual Studio is entirely open source under the Apache license and they welcome contributions and bug reports. It's Alpha and it's early but it's awesome. Go get it. Big congrats to all involved!

Sponsor: Thanks to Red Gate for sponsoring the feed this week! Easy release management: Deploy your .NET apps, services and SQL Server databases in a single, repeatable process with Red Gate’s Deployment Manager. There’s a free Starter edition, so get started now!

Disclosure: FYI, Red Gate does advertise on this blog, but it was a total coincidence that a Red Gate employee helped with node.js Tools for VS. I just found that out today. They are very nice people.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
November 21, 2013 21:41
Fantastic! This looks awesome.

I've played about with NodeJS in WebMatrix and a bit standalone.

Looking forward to getting stuck in with VS.
November 21, 2013 21:56
Wow. i really can't keep up, still great news, keep steering.
November 21, 2013 22:00
Or you can install nodejs directly from VS by running "cinst nodejs" in package manager window. Love chocolatey.
November 21, 2013 22:35
Is this better than ?
November 21, 2013 22:45
This has to be the most comprehensive 'Alpha' I've used in a while :) Just spent 30 mins playing with the tooling and another 20 watching the intro video on codeplex. As far as my needs are concerned, this is already very close to other released products and plugins from major vendors I've used.

Some may see this as a lack of focus on MS's part, trying to be everything to everyone...but I see it as the exact opposite. This is laser focus on delivering a first class development experience. Not .Net development, Development. These are tools I need to complete that story for myself, so I'm just glad many dev's at microsoft feel the same way.
November 21, 2013 22:48
Amazing¡ Another reason to use Visual Studio this looks awesome. I'm going to try NTVS with Ghost too.
November 21, 2013 22:59
Great, Great, Great !!!!!!!!
November 21, 2013 23:42
Love the detailed and thorough post Scott and good on these guys for providing a cool story for Node developers without MS'izing it!
November 21, 2013 23:48
Can I use update panels with this?
November 21, 2013 23:51
Hi Scott,

Maybe just add that you need to run npm install before you run debug. Use it don't use it.

Any case great article. Can't wait to start coding node in vs
November 22, 2013 0:22
Is there any way to use this with Azure Mobile Services?
November 22, 2013 0:34
but what is the benefit of node.js for .Net Developer ?
it is cool tool if you use them as stand alone framework .
November 22, 2013 0:51
This is incredibly cool! Great stuff has been coming out of Redmond for a while now, and this is yet another example of how much you guys embrace OSS. Love it!
November 22, 2013 1:20
I'm gonna cry!
Scott you and ypur team are my heroes.

Soon i'll be writing spanish version / adaptation of this article.
November 22, 2013 1:30
Cristy - Heh, yes, definitely better than Visual Node, and we'll be encouraging Visual Node users on to Node Tools for Visual Studio.
November 22, 2013 1:31

VS2013 will be a great place to spend a work day on!!
November 22, 2013 1:32
Thanks for the fantastic and comprehensive write-up of NTVS Scott!
November 22, 2013 1:33
This is so great!

MS is again trying to win over developers, that is the right path to follow...
November 22, 2013 1:50
Cristy - note that VisualNode is RedGate...who helped with NTVS, so yes. Thanks Bart!

John - Good idea! ;)
November 22, 2013 2:10
I will admit that Hanselman continues to impress. Maybe you should be the one to replace Balmer. As long as Balmer is at the helm, I won't be able to trust MS enough to build products for their platform anymore.
November 22, 2013 3:26
I've been using node.js for various things for the better part of three years now. Here's just a few things I've used it for, in conjunction with .Net.

1. Pre-processing import files, in various formats, so that tooling in .Net that hasn't been updated in half a decade can continue to push data into an overly normalized backend.

2. Acting as a client for a remote SOAP service that only exposes "OBJECT" in the wsdl, which .Net doesn't deal well with, and exposing a clean REST/JSON set of endpoints to be used in a large .Net application.

3. Acting as a quick client-side build tool for client code where the larger server-side part of the project is in .Net

These aren't all that I've done, just a few things that have worked well... when you need a quick piece of code that needs to be flexible, a scripted environment can work out much better than a more rigid compiled one. YMMV but I find there to be a lot less friction in many projects utilizing node.js over C#/.Net but that doesn't mean I'll rewrite something for the sake of, when a small stub/shim can do the job.
November 22, 2013 3:50
I think Visual Studio should be the OS, the productivity suite (Office), the IDE and all the rest... feeling like writing an iTunes add on for VS so you can manage your music from the it while coding...
November 22, 2013 4:50
Good job guys. I use Windows to code Linux/Web all day. You guys know GUI better than anyone else.
November 22, 2013 5:39

I noticed that it doesn't appear that I can add Node.js projects to solution folders in VS2012..? (This worked with Visual Node ;))

I try to drag them into a folder, but they just stay at the "root level"..
November 22, 2013 6:17
Thanks for letting us know Rune, I verified it and filed an issue on CodePlex.
November 22, 2013 7:18
I went to a recent meetup where he demonstrated node.js. He was using WebStorm for his development IDE because VS did not work too well with node. Problem solved. I was that (finger and thumb close together) close to buying WebStorm and may still, but I am most comfortable is VS and prefer to use it. I am looking forward to using it for development for my Rasberry Pi. Remote debugging!
November 22, 2013 8:01
Great stuff Scott. Thanks for posting. I like me some node.js. I also like where Visual Studio is going. Keep up the good work!
November 22, 2013 9:06
Way to go, tt can encourage more enterprises to adopt nodejs.
November 22, 2013 10:14
I wonder if debugging works for Meteor... Now THAT would be awesome.
November 22, 2013 10:24
Why is devdiv so awesome!!! Thanks guys!! You rock for making Visual Studio.
November 22, 2013 12:45
Sweet beans.

Do you know if there's anything for memory profiling or finding memory leaks?
November 22, 2013 12:52
Visual studio and open source! :)
November 22, 2013 13:29
Very nice!
Next step: Meteor support - that would be awesome!
November 22, 2013 14:18
Not long time ago but Komodo Edit are first one to show intellisense for Nodejs Module. I look further in Microsoft tools. I write more then thousands of posts on Uservoice to make nodejs support in Webmatrix.

We have Nodejs support in Microsoft webmatrix 1.5 years ago. The big problem with webmatrix is it's design very badly. the interface is simple but doesn't support stop the intellisense. even hang and crash too much.

Is this have anything special then Nodejs support found in webmatrix.
November 22, 2013 15:03
Does this tools support Visual Studio 2013 Web Express .?

November 22, 2013 15:32
Sounds pretty awesome. Do you happen to know if there is "deep" TypeScript integration? That would make for a double whammy IMO
November 22, 2013 17:30
I like Visual Studio, but not for $1200. I'll stick with Webstorm at $50 for my Node development until pricing comes down from the stratosphere.
November 22, 2013 19:32
@ Craig

If you're paying $50 for WebStorm you're presumably getting the personal license in which case you can pick up Visual Studio with an Action Pack subscription for around $300 I think (I paid for mine UK Sterling so don't know exact figure). It depends what you want, I like Webstorm but it's only meant for HTML, CSS and JS - you're comparing apples with oranges as with an Action Pack you get tons of stuff, SQL Server, Office, various versions of Windows.
November 22, 2013 21:34
Really amazing! good job. I just unknow how it could be totally usefull in future of VS.

Today, I "missing" tools like Bower and Grunt in Visual Studio to front-end responsability like tasks and JS library package management than Nuget.
November 22, 2013 22:49
Would love to a project template for Azure Mobile Service Scripts. This is awesome without a doubt.
November 22, 2013 23:45
Really Nice post, Keep writing on Node.js and Visual studio. Waiting for more article on Node and VS.
November 23, 2013 0:15
Extremely cool. I am going to download it as soon I get home.
November 23, 2013 0:27
@ BangaruBabu

Nope. I also asked this question to the NTVS team and they said it is not possible now but they are going to try it later.
November 23, 2013 0:36
@ Craig, we have a feature request in the tracker to provide some way to enjoy NTVS for free, and we're actively looking into it:
November 23, 2013 0:50
Hmm... As @joevwalt said, you need to run "npm install" on the ghost directory first. I can run Ghost, but still not NTVS on it. I followed the instructions to debug Ghost but I am getting MODULE_NOT_FOUND warnings.
November 23, 2013 0:57

I do not qualify under the terms of the MPN terms and conditions. I suppose many fake their way through that but I will not.
November 23, 2013 1:06

Wow, awesome sauce!
November 23, 2013 2:04
So what's the update on getting node talking to sql server?
November 23, 2013 3:07

I like Tedious

It's OS agnostic.
November 23, 2013 3:10
This is pretty good news for all the die hard Visual Studio fans. Although most node.js developers prefer to work with a text editor and a command line interface.
November 23, 2013 4:02
I really like you, and the stuff you do and talk about. Put a facebook share button on this blog, to share this wonderful stuff with others...
November 23, 2013 11:16
Really would be better if it had supports for VS 2012/2013 express edition
November 23, 2013 17:02
Installed !!! thanks for sharing this
November 24, 2013 5:44
I fixed my problem. "npm install --production" was failing to complete. Running "npm cache clean" fixed it.
November 24, 2013 7:55
This is crazy.
November 24, 2013 10:13
Nice transition in the header.
November 24, 2013 10:57
I have tried but got the error Object Reference not set to instance of an object when try to open the project. I can't figure out why the error is shown.
November 25, 2013 5:09
pretty cool!
November 25, 2013 17:05
I'm using over node.js and since node on a regular Azure site does not support (as far as I understood it was due to issues with web sockets support) I am currently deploying my project as a Cloud Service.
Is there a project template that supports this configuration?
It currently seems that the node Azure project is targeted at a regular web site hosting node using iisnode.

cross post from:
November 25, 2013 20:18
@A Z Khairuzzaman, make sure you've installed the latest VS2012 update from here:
November 25, 2013 21:55
I would be amazed if... if... if Microsoft would not have cancelled a lot of very promising add-ons to Visual Studio in the past. Imagine you invested a project in IronPython or even IronRuby? What about your XNA projects? Etc. pp.

Don't get me wrong, I do like that we get a Node environment in VS. But I BET it will not be supported any more in less than two years. Don't mention open source... Forcing some bored juniors inside MS to build a "hip" add-on to achieve their checkmarks on their career plan does not necessarily lead to a huge community caring about the source - once those very junior programmers get promoted to program managers number 1532-1538.

See how stale Stylecop became after Microsoft "donated" it to the community? Or Sandcastle?

I really feel a bit like MS's stance is: "We could if we want, we have proven if, but get back to our Windows Store Apps/Azure and a tiny bit of web strategy." People don't believe MS that they care about OSS that does not contribute to the MS tech stack.

Another issue: The advantage of the Node infrastructure is low friction. Visual Studio is purest friction - mostly achieved through almost absurd complexity and latency (for example startup time especially with Resharper...).

Some prefer automation over simplicity, and I see this point (and I work with VS and recommend for this very reason). But the classical vim/Sublime Text user will never be converted to use Visual Studio. And Mr. "Dumbo" Intellisense will never be converted to dynamic languages and tech stacks were your are supposed to reads docs before you start instead of pressing "." and hoping for finding the "right" method.

The last main problem with acceptance of these tools will always be that people want a free full Visual Studio that accepts all extensions and add-ons (okay, skip the "architecture" stuff for rich UML zealots). Not everyone loves faking e-mail addresses for BizSpark accounts every 3 years.

Given the fact that MS survives by selling Office and SQL Server licenses these days I bet that Visual Studio Premium for free would actually have a positive impact on the community.

November 26, 2013 6:05
i was hitting a weird error where "when" was being passed in as the request. i fixed by doing 'npm install' on the ghost directory.
November 26, 2013 6:39

>> Don't get me wrong, I do like that we get a Node environment in VS. But I BET it will not be supported any more in less than two years.

As Scott has noted in the article, this comes from the team that had previously brought to you Python Tools for Visual Studio. As it happens, that project is over two years old now (the first public beta came out in March 2011)- and the team has grown considerably since then. That project is still going strong, with a 2.0 release this past October, and we're actively working on vNext.

Also, as a member of this team, I can assure you that "bored juniors building a hip add-on for career plan" is about as far from what this team is as possible - literally, every single word except for "add-on" is wrong :)

>> And Mr. "Dumbo" Intellisense will never be converted to dynamic languages and tech stacks were your are supposed to reads docs before you start instead of pressing "." and hoping for finding the "right" method.

You'd actually be surprised at how good Intellisense can be for dynamic languages. If you haven't seen our video on Intellisense in Python, have a look! I dare say that it's pretty good at delivering the experience where you can, quite literally, press "." and hope to find the right method in many frameworks. Granted, the story for JS is not quite as mature yet, but we're working on it.
November 26, 2013 15:23
@ craig

If that's the case then why do it for JetBrains? If you're only paying $50 then you're not paying for the professional license!
November 26, 2013 17:49
Very cool progress. I'd very much like to see a UI for managing grunt tasks, kind of like the npm UX. I don't use the bundler in my MVC/WebApi projects. Instead, I use grunt. I've had to hack it into the workflow (including a separate command-line always open for `grunt watch`). It works for now, but if the node.js tools (or something similar) gave me access to grunt tasks as firt-class citizens of the IDE, then, well... that would be awesome :)
November 26, 2013 23:06
@ Matthew
- Webstorm personal license $49: I pay.
- Webstorm professional license $99: Company pays.
- Both allow for general commercial use.

- MPN Action Pack: requires a company selling 75% of its developed MS software to outside customers.
November 27, 2013 5:47
why create the project,under the npm,all the module is missing,why?
November 27, 2013 19:04
Have tried but got the error Object Reference not set to instance of an object when try to open the project.

"VS 2012"
November 27, 2013 21:56
Gotta try this
November 28, 2013 2:54
Is there a way to set environment variables? for example NODE_PATH
November 28, 2013 13:59
Same as A Z Khairuzzaman posted:
I have tried but got the error Object Reference not set to instance of an object when try to open the project.

I am using:
Microsoft Visual Studio Premium 2012
Version 11.0.50727.1 RTMREL
Microsoft .NET Framework
Version 4.5.50709

Installed Version: Premium

Node.js Tools 1.0.11119.03
Adds support for developing and debugging Node.js apps in Visual Studio

Node.js Tools - Profiling 1.0.11119.03
Profiling support for Node.js projects.

NuGet Package Manager 2.0.30625.9003
NuGet Package Manager in Visual Studio. For more information about NuGet, visit

November 28, 2013 19:21
This looks awesome! Is it just as easy to use Typescript with node?
November 29, 2013 9:35
loving to try it
December 04, 2013 5:43
It dose't work on my vs2012, Did I need to upgrade vs to the latest version?
December 05, 2013 6:48
"Just hit F5..." Really? I'm not sure that Scott actually got the Ghost Blog site actually running in NTVS. For one, he didn't mention how to fix the missing NPM modules in the /npm folder (type "npm install" in elevated command prompt from the project root folder). Even if you fix this, you still get a "TypeError: Cannot read property 'message' of undefined" in the errorHandling.js... This error occurs in both VS2012 and VS2013. Has anyone actually got the Ghost Blog site running?
December 07, 2013 9:17
Looks nice so far. One thing I noticed is that the npm module manager thing looks pretty bad on a retina MBP (13in October 2013 version, for what it is worth). I can see the icon and the title (and that everything appears to be by unknown author), but the description that it shows on Scott's screenshot above is cut off.
December 10, 2013 6:13
Scott - I had the same problem as @nuri. When I followed the instructions above, I ran into a couple issues:

  • first, I installed all of the node packages by opening a command prompt and running: npm install --production
  • if I then run "npm start" ghost starts up and I can navigate to with no issue.
  • however, if I try to run it inside VS 2013, it errors out trying to load module iconv
  • I installed python 2.7.6 and attempted to install is by running "npm install iconv", but then got a compile error:

    MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
    To fix this, 1) install the .NET Framework 2.0 SDK,
    2) install Microsoft Visual Studio 2005 or
    3) add the location of the component to the system path if it is installed elsewhere.
    [C:\ghost-0.3.3\node_modules\iconv\build \binding.sln]

    That's where I stopped. Anyone else get any further?

December 13, 2013 17:56

Your compilation error looks similar to something I ran into yesterday with another node module. We determined that it was because the built-in "node-gyp" module does not support VS 2013. I was able to update the built-in node-gyp to the latest version by following the instructions found here:

Hope this helps,
December 14, 2013 4:49
Great show, love for Express? Say it isn't so!
December 16, 2013 11:09
nice tools i'll be using it for managing my visual website assets. thank you and please share some tips for using this tool for websites as well .
December 17, 2013 23:43
I tried to get the ghost project working in visual studio by hitting F5 but get the following error:

Error: Cannot find module './binding\Debug\node-v11-win32-x64\node_sqlite3.node'

I did a npm install sqlite3 from the directory but doesn't really do anything. I can ignore the errors and the site loads and runs the main page however I do not have that directory/file in my application at all.
December 23, 2013 19:04
So, no support for express. Shame on M$
December 26, 2013 10:10
If I'm working in Ruby, or using something like Yeoman to start up a new Angular project or something, I use Webstorm or Sublime + terminal on a Linux box rather than on Windows (or a VM if I'm on my computer with Windows). That's at least until ruby / yeoman and other tools catch up to allow ease of development on a Windows system.
January 06, 2014 4:28
Node.js-friendly ASP.NET Solution Template for Visual Studio:
January 06, 2014 9:01
@Zhi Error: Cannot find module './binding\Debug\node-v11-win32-x64\node_sqlite3.node'

I had the same error. sqlite3 is built by default in the Release directory. Changing my directory name from Release to Debug solved this error for me.
January 06, 2014 9:55
@Jay I was able to get through all the iconv errors by upgrading node-gyp as Tim suggested and installing iconv with the following:

npm install iconv --production --msvs_version=2013

However after all that and starting it error free in the debugger as soon as I navigate to I get many null errors and then it shuts down.
January 09, 2014 13:11
For anyone experiencing problems like: "Object Reference not set to instance of an object"

you have to install vs2012 updates!

Thanks for your excellent product! it saves lot of time on debugging!
January 16, 2014 2:17
You mention that you really like the node dependency tree. Unfortunately, especially on windows / in visual studio, it's your own worst enemy.

Due to windows file pathing restrictions, the nested nature of node packages when downloaded means that for some packages, you end up with a dependency tree that is too deep for windows to handle.

I'd much prefer a visualizer like what you see above, but a folder-structure identical to nuget (all packages at one level, with their version numbers in their name)
January 16, 2014 2:51
No VS express support? I guess you don't want people to use this...
February 01, 2014 6:33
I am taking the MongoDB for node.js course for a first taste of node. Did the first couple of weeks in Notepad++ before installing "Node Tools". Much nicer experience and now all my keyboard shortcuts work. This is a very nice mapping of node over to the VS experience. I like how npm behaves similarly to NuGet. I am sure it will just get better.
February 02, 2014 12:12
Peter Dolkens, this is what we did in Web Essentials' build process.
February 12, 2014 14:17
I know old posts are not scanned regularly. But there is NO release update since this article, only some internal builds. Let's see how quickly everyone forgets about this project... I keep coming back.
February 18, 2014 3:33
Daniel - Just updated the home page and news page the Beta will be at BUILD. But you can get dailies now if you want.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.