http.createServer missing in intellisense

Dec 6, 2013 at 3:41 PM
Hello,

I've installed the Node.js tools for VS 2012. I'm trying to follow along with a Pluralsight video Pluralsight node.js class

It's a fairly old video, so he's on version .1.something, I'm on v0.10.22. At any rate, the project he's trying to create is using code like the following:
var server = http.createServer
I don't see the createServer method (or the createClient method), even though it should be there according to the node.js documentation:

Node.js documentation

Am I missing something, or is this a "known issue" with Intellisense on the VS Node.js Tools?

Thanks,
Eric
Coordinator
Dec 6, 2013 at 5:04 PM
This should "just work" regardless of the Node version you're on (we have a hard coded list of the built-in modules such as http). What do you see after you type http. ? Do you see a list of completions with exclamation points in a yellow triangle?

The one thing I can think of is that the require call is messed up somehow, you should have entered something like:

var http = require('http');

Before doing the http.
Dec 6, 2013 at 5:19 PM
Hi,

When I type http.creates in Visual Studio, the only completion I see is http.createStylesheet.

Here's my complete server.js code:
var http = require('http');
var sys = require('sys');
http.creates
var server = http.createServer(function(request, response) {
    request.addListener('end', function() {
        response.writeHead(200, { 'Content-Type': 'text/plain' });
    });
    response.write();
    response.end();
});

//Default code that was put in by NTVS
//var port = process.env.port || 1337;
//http.createServer(function (req, res) {
//    res.writeHead(200, { 'Content-Type': 'text/plain' });
//    res.end('Hello World\n');
//}).listen(port);
Even though Intellisense doesn't show that createServer is there, if I uncomment out the default code, I see "Hello World" display in my browser, so it is working.

-Eric
Coordinator
Dec 6, 2013 at 7:28 PM
Weird, the createStylesheet showing up is a little surprising. Do you have any other files in your project or have you installed any packages via npm?