How can I get Visual Studio 2013 to allow Node.js require () modules and provide intellisense?

I am using Node.js 4.0.0 and an update for Visual Studio 2013 5. My code builds and works fine using Gulp, but I cannot get the required modules for the intellisense clause.

My project is an ASP.NET web application.

For example, I have a file as follows:

//constants/ActionTypes.js
'use strict';

module.exports = {
    REQUEST_FILES: 'REQUEST_FILES',
    RECEIVE_FILES: 'RECEIVE_FILES'
};

Then I import it into another file with require:

'use strict';

var ActionTypes = require('../constants/ActionTypes');

ActionTypes. <--- does not offer intellisense completion.

I installed the following Visual Studio extensions, which I thought would help with this:

  • Node.js Tools 2.5
  • WebEssentials 2013.5 2.6.36

I already installed my project before installing Node.js Tools and did not use Node.js Tools templates. Is there some kind of configuration that I need to do for my existing project?

intellisense ?

+4

Source: https://habr.com/ru/post/1611958/


All Articles