sails-permissions icon indicating copy to clipboard operation
sails-permissions copied to clipboard

Cannot find module sails-auth

Open ghadeer-rahhal opened this issue 10 years ago • 5 comments
trafficstars

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)

ghadeer-rahhal avatar Jul 20 '15 15:07 ghadeer-rahhal

I can confirm this problem.

michelbb avatar Jul 21 '15 16:07 michelbb

Yes same for me too.

dottodot avatar Jul 22 '15 11:07 dottodot

:+1:

dbkaplun avatar Jul 22 '15 23:07 dbkaplun

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 avatar Aug 07 '15 14:08 dottodot

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

dottodot avatar Aug 07 '15 14:08 dottodot