New Features in Node Tools for Visual Studio’s December Dev Build

It’s only been a month since the first alpha, but a lot has happened since with fixes and improvements to intellisense, various areas of the user interface, solution explorer, build, the REPL, along with the npm support that Red Gate has been working on.

In this post I’m going to run through the npm improvements.

The first to mention is the much requested npminstall support for missing packages, which will take you from this…

to this…

just by clicking Install Missing npm Packages on the npm node’s context menu in Solution Explorer.

We’ve also improved the npm output log by updating the status bar whilst npm is running, and telling you whether the command completed successfully or not, so now you don’t need to have the Output window open to see what npm is doing.

Similarly, we’ve also added support for npm update with an Update npm Modules command on the npm node context menu.

You can also perform npm tasks on individual modules by right-clicking on them and selecting one of the following options:

Note that these commands will only work on top-level modules listed immediately below the npm node to avoid corrupting your module installations. Remember that sub-modules are installed because they are required for your top-level modules to work properly, at least in most cases!

One of the npm bugbears from the alpha was that the package repository catalogue was not cached across Visual Studio sessions. This lead to a sometimes significant delay when switching to the Search npm Repository tab in the npm Package Management dialog the first time you opened it in your Visual Studio session before the list of all available packages was populated.

I’m pleased to say we now cache the contents of the package repository catalogue across sessions, so you can always search for packages quickly.

Of course, new packages are being published all the time – some 3,000 or more over the past 6 weeks or so have been added to the repository – so the cache can quickly become out of date. We therefore allow you to re-download the repository catalogue any time you like, and tell you the last time you refreshed your cached copy. Just click the new Refresh Catalog button.

You can see that my cache of the repo contents is now 4 days old so I should probably think about updating it. The longer you leave it, the more politely assertive the message about how long since you last updated becomes!

Note that we don’t force you to update your cache on a schedule because, as we’ve already said, sometimes this can take a minute or two (generally it should take only a few seconds, depending upon your connection speed, etc.).

Finally, there have been numerous bug fixes, notably for gracefully handling invalid package.json files. In many cases errors in package.json are now reported in the Output window, which will make it easier for you to find and fix them.

Expect to see many more improvements over the coming releases leading up to the beta.