Open alonbardavid opened 11 years ago
Same problem here - any possible fixes?
var mongoose = require('mongoose')
, troop = require('mongoose-troop');
F:\dev\workspace\QSine\src\portal\node.js\node_modules\mongoose-troop\node_modules\directory\lib\directory.js:23
var filename = path.split(dirname)[1].split(".js")[0]
^
TypeError: Cannot call method 'split' of undefined
at F:\dev\workspace\QSine\src\portal\node.js\node_modules\mongoose-troop\node_modules\directory\lib\directory.js:23:45
at Array.forEach (native)
at modulate (F:\dev\workspace\QSine\src\portal\node.js\node_modules\mongoose-troop\node_modules\directory\lib\directory.js:21:9)
at Object.
I am unable to use the library on windows. The following error occurs: TypeError: Cannot call method 'split' of undefined at node_modules\mongoose-troop\node_modules\directory\lib\directory.js:23:45 at Array.forEach (native) at modulate (node_modules\mongoose-troop\node_modules\directory\lib\directory.js:21:9) at Object. (node_modules\mongoose-troop\index.js:8:21)
looks like when you try to require all the nested indexes under lib, you pass __dirname + /lib/ to the directory module, which eventually tries to split: node_modules\mongoose-troop\lib\acl.js with: node_modules\mongoose-troop/lib/
obviously failing.