handlebars .hbs view in expressjs doesn't load my partial

  # app.js
  app.set('view engine', 'hbs');

  # ./views/layout.hbs
      {{> nav}}

  # ./views/nav.hbs
      <a href="#">home</a>

The layout.hbs file is not finding my partial nav.hbs

I get the following error on node app.js console:

throw new Handlebars.Exception("The partial " + name + " could not be fo ^

You need to first register the partial "nav" that you want to use. I found the answer at Express.js hbs module - register partials from .hbs file works well for me. The gist is:

var template = fs.readFileSync(partialsDir + '/' + filename, 'utf8');
hbs.registerPartial(name, template)

Your problem is that you're using express 3.x, which significantly changed the way it handles templating from how it was done in 2.x. In particular, 2.x makes a bunch of assumptions about how partial templates fit into an overall layout, whereas 3.x leaves that up to the layout engine itself. But ejs will continue to have the same behavior under express 3.x.

Note: Turned my comment into an answer, since it was addressed to your problem