title: Node.js , path.js crashes after a lot of users connect to application
body: <p>Hi guys I have an application written in Express.js , and Im using socket.io to display realtime data to users. </p>
  
  <p>When there is more then lets say 10 users on the website suddenly node servers crashes and Im getting this error </p>
  
  <pre><code>path.js:309 var path = (i &gt;= 0) ? arguments[i] : process.cwd();
  </code></pre>
  
  <p>Even if I'm alone on the website and I refresh page multiple times , or just stay on the website and click on the pages I get the same error , does anyone knows how to fix this ?</p>
  
  <p>EDIT : This is the whole error </p>
  
  <pre><code>path.js:309
        var path = (i &gt;= 0) ? arguments[i] : process.cwd();
                                                     ^
  Error: EMFILE, too many open files
      at Object.exports.resolve (path.js:309:52)
      at ExpressHandlebars.extend.loadTemplate (/Users/sredoje/Downloads/expressjs-template/node_modules/express3-handlebars/lib/express-handlebars.js:111:25)
      at ExpressHandlebars.load (/Users/sredoje/Downloads/expressjs-template/node_modules/express3-handlebars/lib/express-handlebars.js:153:18)
      at /Users/sredoje/Downloads/expressjs-template/node_modules/express3-handlebars/node_modules/async/lib/async.js:224:13
      at /Users/sredoje/Downloads/expressjs-template/node_modules/express3-handlebars/node_modules/async/lib/async.js:108:13
      at Array.forEach (native)
      at _each (/Users/sredoje/Downloads/expressjs-template/node_modules/express3-handlebars/node_modules/async/lib/async.js:32:24)
      at async.each (/Users/sredoje/Downloads/expressjs-template/node_modules/express3-handlebars/node_modules/async/lib/async.js:107:9)
      at _asyncMap (/Users/sredoje/Downloads/expressjs-template/node_modules/express3-handlebars/node_modules/async/lib/async.js:223:9)
      at Object.map (/Users/sredoje/Downloads/expressjs-template/node_modules/express3-handlebars/node_modules/async/lib/async.js:201:23)
      at ExpressHandlebars.mapTemplates (/Users/sredoje/Downloads/expressjs-template/node_modules/express3-handlebars/lib/express-handlebars.js:157:19)
      at fn (/Users/sredoje/Downloads/expressjs-template/node_modules/express3-handlebars/node_modules/async/lib/async.js:579:34)
      at Object._onImmediate (/Users/sredoje/Downloads/expressjs-template/node_modules/express3-handlebars/node_modules/async/lib/async.js:495:34)
      at processImmediate [as _immediateCallback] (timers.js:330:15)
  &gt;&gt; application exited with code 
  </code></pre>
  
  <p>8</p>