简体   繁体   English

sails-auth模块给出了“无法读取属性'loadStrategies'的未定义”

[英]sails-auth module gives “Cannot read property 'loadStrategies' of undefined”

I've installed the npm module and when lifting my application, it gives the following error. 我已经安装了npm模块,当解除我的应用程序时,它会出现以下错误。 I was not able to find any suitable solution in the GitHub Issues or Wiki. 我无法在GitHub问题或Wiki中找到任何合适的解决方案。

The module is here . 该模块在这里 I've already included in my config directory passport.js and auth.js files, as they have noted. 我已经在我的配置目录中包含了passport.js和auth.js文件,正如他们已经注意到的那样。

$ 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)

I had the same problems in one of my sails app repositories. 我在我的一个应用程序存储库中遇到了同样的问题。 I fixed it by installing a previous version of sails-auth. 我通过安装以前版本的sails-auth来修复它。

npm install sails-auth@1.2.3

This fixed it for me. 这为我修好了。 I also updated dependency reference for my package.json from 我还更新了我的package.json依赖引用

"sails-auth": "^1.0.10",

to

"sails-auth": "1.2.3",

After this I was able to lift with no problems. 在此之后我能够毫无问题地举起。 I created an issue report here: https://github.com/balderdashy/sails/issues/3385 我在这里创建了一个问题报告: https//github.com/balderdashy/sails/issues/3385

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法读取未定义的属性“auth” - Cannot read property 'auth' of undefined 无法将Sails-Auth库集成到Sails项目中 - Unable to integrate sails-auth library in sails project 无法读取未定义的属性“模块” - Cannot read property 'module' of undefined TypeError:无法读取未定义Vuejs的属性'$ auth' - TypeError: Cannot read property '$auth' of undefined Vuejs 信封:无法读取sails.js 中未定义的属性“id” - Envelope: Cannot read property 'id' of undefined in sails.js Firebase 存储与 firebase nuxt 模块给出删除文件后无法读取未定义的属性“删除” - Firebase Storage with firebase nuxt module gives Cannot read property 'delete' of undefined after deleting the file 无法读取未定义 reactjs Jwt Auth 的属性“令牌” - Cannot read property 'token' of undefined reactjs Jwt Auth 无法读取未定义的属性“电子邮件”; firebase auth(); 使用 Vuex - Cannot read property 'email' of undefined; firebase auth(); using Vuex 使用jsPDF保存pdf会出现错误:无法读取未定义的属性'elementHandlers' - Saving pdf with jsPDF gives error: Cannot read property 'elementHandlers' of undefined 它给 Uncaught TypeError: Cannot read property '8' of undefined 带来的“characterIndex”有什么问题? - what the problem with "characterIndex" it gives Uncaught TypeError: Cannot read property '8' of undefined?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM