ericf / express-handlebars

A Handlebars view engine for Express which doesn't suck.
BSD 3-Clause "New" or "Revised" License
2.31k stars 384 forks source link

Path of dirPath cannot be resolved #24

Closed talamaska closed 11 years ago

talamaska commented 11 years ago

I have move the middleware as separate file. I thought it is the problem bu have cloned your repository and i ran the advanced example, i have tried my changes direktly , everything seem too work then i have move the advance example as separate folder/project installed npm stuff. tried to run - error

path.js:116
        throw new TypeError('Arguments to path.resolve must be strings');
        ^
TypeError: Arguments to path.resolve must be strings
    at Object.exports.resolve (path.js:116:15)
    at ExpressHandlebars.extend._loadDir (C:\server\www\testproject-handlebars\node_modules\express3-handlebar
s\lib\express-handlebars.js:234:24)
    at fn (C:\server\www\testproject-handlebars\node_modules\async\lib\async.js:579:34)
    at Object._onImmediate (C:\server\www\testproject-handlebars\node_modules\async\lib\async.js:495:34)
    at processImmediate [as _immediateCallback] (timers.js:330:15)

inspected the code of the module

on line 233 dirPath = path.resolve(dirPath);

if i console log here console.log(dirPath);

dirPath is an array [ 'shared/templates/', 'views/partials/' ]

please help

milyord commented 11 years ago

The issue with this is that npm doesn't have the latest version of express3-handlebars published. Clone the gitgub repo in your node_modules dir to get the newest changes. Make sure to run npm install from within express3-handlebars folder. The package needs to be republished to npm!

talamaska commented 11 years ago

ok, i'll try

ericf commented 11 years ago

Or just point to the this GitHub repo in your package.json.