Open drj-io opened 8 years ago
+1
+1 Having same issue.
+1 I'm new to sailsJS, do not know why this happened. Reproduce Step:
info: Starting app...
C:\yole\code\sails-auth-test\node_modules\sails-auth\api\hooks\sails-auth.js:4 sails.services.passport.loadStrategies(); ^
TypeError: Cannot read property 'loadStrategies' of undefined at Hook.initialize (C:\yole\code\sails-auth-test\node_modules\sails-auth\api\hooks\sails-auth.js:4:30) at Hook.bound as initialize at C:\Users\yinglli\AppData\Roaming\npm\node_modules\sails\lib\hooks\index.js:74:14 at C:\Users\yinglli\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:451:17 at C:\Users\yinglli\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:441:17 at _each (C:\Users\yinglli\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:46:13) at Immediate.taskComplete (C:\Users\yinglli\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:440:13) at processImmediate as _immediateCallback
resolved by specify version to 2.1.1 in package.json
This is from a repository that I originally started in sails .11.0.0. Later cloning my app repo and doing npm install breaks my app.
$ sails lift
info: Starting app...
/home/david/x/webapp/node_modules/sails-auth/api/hooks/sails-auth.js:4 sails.services.passport.loadStrategies(); ^ TypeError: Cannot call method 'loadStrategies' of undefined at Hook.initialize (/home/david/x/webapp/node_modules/sails-auth/api/hooks/sails-auth.js:4:31) at Hook.bound as initialize at /home/david/x/webapp/node_modules/sails/lib/hooks/index.js:75:14 at /home/david/x/webapp/node_modules/sails/node_modules/async/lib/async.js:451:17 at /home/david/x/webapp/node_modules/sails/node_modules/async/lib/async.js:441:17 at _each (/home/david/x/webapp/node_modules/sails/node_modules/async/lib/async.js:46:13) at Object.taskComplete (/home/david/x/webapp/node_modules/sails/node_modules/async/lib/async.js:440:13) at processImmediate as _immediateCallback This was working fine with sails-auth 1.0.10 but broke with sails-auth 1.2.3 .
Would love to be current. I answered this SO issue here too: http://stackoverflow.com/questions/32792853/sails-auth-module-gives-cannot-read-property-loadstrategies-of-undefined