devxlogo

Build Node.js Apps Using Visual Studio 2013

Build Node.js Apps Using Visual Studio 2013

There is some good news for Visual Studio enthusiasts looking to develop web applications using Node.js. The Visual Studio team (with help from the community contributors) recently released the support for Node.js in Visual Studio 2013. While this is still in beta, and you may face issues while developing apps, it is definitely worthwhile to explore the features now and provide feedback to the team.

You can down the Node.js Tools for Visual Studio (NTVS) from CodePlex here. Follow the steps in the installation wizard to setup NTVS.

Once you have successfully installed the tools, you will see a bunch of templates showing up in the New Project Dialog under the Node.js section below JavaScript.

The predefined templates help you create a New Node.js Web Application, a New Azure Website built using Node.js, and a Worker Role with support in Node.js for creating long running processes using Node.

Note that Node.js is already supported by Azure Mobile Services and you can directly run Node.js scripts from Azure Mobile Services by configuring them in the Azure portal.

You can also create a project from existing Node.js code (which is likely to be the case if you were already developing on Node.js).

Select the “From Existing Node.js code” template. The dialog will launch a wizard to let you select the folder where your Node.js project is placed. It will enlist the Node.js start-up file if it finds one like the screenshot shown below:

(It is a good option to select “Exclude node modules”, since they will unlikely to be your start-up app).

You are all set, but when you build your project, it is most likely to fail, since the node modules will not be present or correctly referenced. Right click on the project and use the “Open Command Prompt Here” command to launch the command prompt and use the “npm install” command to install the node modules.

The NTVS tools also provide a nice option to manage and install global node modules. In your solution structure, expand npm and click Manage Node Modules from the Global Modules context menu. The module manager dialog will be launched where you can search and install global node modules.

You are now all set to start developing your Node.js project from within Visual Studio 2013. Since this is built on the underlying V8 JavaScript engine, you can leverage the power of debugging JavaScript applications seamlessly. You also benefit from the usual Visual Studio IntelliSense features for JavaScript. In future posts we will explore more regarding the debugging and deployment aspects, and look at creating a worker role with Node.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist