title: 500 Error: ENOENT, open 'C:\Users\Gilbert\WebstormProjects\games\views\layout.hbs
body: <p>I get this error:</p>
  
  <pre><code>500 Error: ENOENT, open 'C:\Users\Gilbert\WebstormProjects\games\views\layout.hbs
  </code></pre>
  
  <p>but my project has no reference to this file. when trying to render a simple test page with HBS, I used a pregenerated express app that created a layout.jshtml file but deleated this file.</p>
  
  <p>app.js: </p>
  
  <pre><code>/**
   * Module dependencies.
   */
  
  var express = require('express')
    , routes = require('./routes')
    , http = require('http')
    , path = require('path');
  
  var app = express();
  
  app.configure(function(){
    app.set('port', process.env.PORT || 3000);
    app.set('views', __dirname + '/views');
    app.set('view engine', 'hbs');
    app.use(express.favicon());
    app.use(express.logger('dev'));
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
    app.use(require('less-middleware')({ src: __dirname + '/public' }));
    app.use(express.static(path.join(__dirname, 'public')));
  });
  
  app.configure('development', function(){
    app.use(express.errorHandler());
  });
  
  app.get('/', routes.index);
  
  http.createServer(app).listen(app.get('port'), function(){
    console.log("Express server listening on port " + app.get('port'));
  });
  </code></pre>
  
  <p>routes/index.js: </p>
  
  <pre><code>/*
  * GET home page.
  */
  
  exports.index = function(req, res){
    res.render('hi.hbs', { title: 'Express' });
  };
  </code></pre>
  
  <p>views/hi.hbs: </p>
  
  <pre><code>&lt;h1&gt;IT WORKS&lt;/h1&gt;
  </code></pre>