trailsjs / sails-permissions

Comprehensive user permissions and entitlements system for sails.js and Waterline. Supports user authentication with passport.js, role-based permissioning, object ownership, and row-level security.
MIT License
418 stars 113 forks source link

Cannot find module sails-auth #91

Open ghadeer-rahhal opened 9 years ago

ghadeer-rahhal commented 9 years ago

The latest version of sails-permissions results in the following error. To get around this, I reverted to version 1.2.1 which seems to works fine at the moment.

Error: Cannot find module 'sails-permissions/api/hooks/sails-auth' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/*/api/hooks/sails-auth.js:4:18) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17)

michelbb commented 9 years ago

I can confirm this problem.

dottodot commented 9 years ago

Yes same for me too.

dbkaplun commented 9 years ago

:+1:

dottodot commented 9 years ago

That commit hasn't made any difference to the original issue reported.

I've update to the lastest versions and still get the error

Error: Cannot find module 'sails-permissions/api/hooks/sails-auth'

If I manually add the file sails-auth.js that use to contain

module.exports = require('sails-permissions/api/hooks/sails-auth');

I now get the error

error: Malformed hook! (sails-auth)
error: Hooks should be a function with one argument (`sails`)
dottodot commented 9 years ago

OK just found the reason. A previous version of sails-permissions must have installed files in api/hooks, and these need to be removed