The sails-auth module gives "Unable to read loadStrategies' property from undefined"

I installed the npm module, and raising the application, it gives the following error. I could not find a suitable solution on GitHub or Wiki issues.

The module is here . I have already included config.js and auth.js files in my files, as they noted.

$ sails lift info: Starting app... /home/me/Documents/projects/margin/node_modules/sails-auth/api/hooks/sails-auth.js:4 sails.services.passport.loadStrategies(); ^ TypeError: Cannot read property 'loadStrategies' of undefined at Hook.initialize (/home/me/Documents/projects/margin/node_modules/sails-auth/api/hooks/sails-auth.js:4:30) at Hook.bound [as initialize] (/usr/local/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21) at /usr/local/lib/node_modules/sails/lib/hooks/index.js:75:14 at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:454:17 at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:444:17 at Array.forEach (native) at _each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:46:24) at Immediate.taskComplete (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:443:13) at processImmediate [as _immediateCallback] (timers.js:358:17) 
+5
source share
1 answer

I had the same problems in one of my sail application repositories. I fixed it by installing the previous version of sails-auth.

npm install sails-auth@1.2.3

This fixed it for me. I also updated the dependency link for my package.json from

"sails-auth": "^1.0.10",

to

"sails-auth": "1.2.3",

After that, I was able to get up without any problems. I created a problem report here: https://github.com/balderdashy/sails/issues/3385

Hope this helps.

+3
source

Source: https://habr.com/ru/post/1232329/


All Articles