Nodejs: Path must be a string. Received null
<p>I was trying to implement the following code and got the TypeError error when I ran it.</p>

<p><strong>app.js</strong></p>

<pre><code>var app = module.exports = require('express').createServer();
var io = require('socket.io').listen(app);
var path = require('path');

app.listen(3000);

app.get('/',function(req,res){
    res.sendfile(__dirname + '/index.html');
});

io.sockets.on('connection', function(socket){
    socket.emit('welcome', {text: 'Welcome!!!'});
});
</code></pre>

<p><strong>Error Output:</strong></p>

<pre><code>TypeError: Path must be a string. Received null
    at assertPath (path.js:8:11)
    at posix.join (path.js:479:5)
    at exports.send (/Users/rluo/Desktop/learn/learnNode/socket.io_epxress/node_modules/express/node_modules/connect/lib/middleware/static.js:129:20)
    at ServerResponse.res.sendfile (/Users/rluo/Desktop/learn/learnNode/socket.io_epxress/node_modules/express/lib/response.js:186:3)
    at /Users/rluo/Desktop/learn/learnNode/socket.io_epxress/app.js:8:6
    at callbacks (/Users/rluo/Desktop/learn/learnNode/socket.io_epxress/node_modules/express/lib/router/index.js:272:11)
    at param (/Users/rluo/Desktop/learn/learnNode/socket.io_epxress/node_modules/express/lib/router/index.js:246:11)
    at pass (/Users/rluo/Desktop/learn/learnNode/socket.io_epxress/node_modules/express/lib/router/index.js:253:5)
    at Router._dispatch (/Users/rluo/Desktop/learn/learnNode/socket.io_epxress/node_modules/express/lib/router/index.js:280:5)
    at Object.Router.middleware [as handle] (/Users/rluo/Desktop/learn/learnNode/socket.io_epxress/node_modules/express/lib/router/index.js:45:10)
</code></pre>

<p><strong>package.json:</strong></p>

<pre><code>{
    "name":"socketio_express-example",
    "version":"0.0.1",
    "private":true,
    "dependencies":{
        "socket.io":"0.8.7",
        "express":"2.5.4"
    }
}
</code></pre>

<p>Thanks in advance.</p>