PassportJS + Babel:passport.initialize不是一个功能

时间:2017-08-22 02:25:47

标签: javascript node.js passport.js babeljs

尝试使用babel-node和一些新的ES6内容来制作SPA api服务器。包括护照证明是一个问题,因为编译后找不到initialize()函数:

10:17:54 PM web.1 |  C:\Users\-\Desktop\bioan\server\app.js:37
10:17:54 PM web.1 |  _auth2.default.initialize(server);
10:17:54 PM web.1 |                 ^
10:17:54 PM web.1 |  TypeError: _auth2.default.initialize is not a function
10:17:54 PM web.1 |      at Object.<anonymous> (C:/Users/-/Desktop/bioan/server/app.js:17:6)
10:17:54 PM web.1 |      at Module._compile (module.js:570:32)
10:17:54 PM web.1 |      at loader (C:\Users\-\Desktop\bioan\server\node_modules\babel-cli\node_modules\babel-register\lib\node.js:144:
5)
10:17:54 PM web.1 |      at Object.require.extensions.(anonymous function) [as .js] (C:\Users\-\Desktop\bioan\server\node_modules\babel
-cli\node_modules\babel-register\lib\node.js:154:7)
10:17:54 PM web.1 |      at Module.load (module.js:487:32)
10:17:54 PM web.1 |      at tryModuleLoad (module.js:446:12)
10:17:54 PM web.1 |      at Function.Module._load (module.js:438:3)
10:17:54 PM web.1 |      at Function.Module.runMain (module.js:604:10)
10:17:54 PM web.1 |      at Object.<anonymous> (C:\Users\-\Desktop\bioan\server\node_modules\babel-cli\lib\_babel-node.js:154:22)
10:17:54 PM web.1 |      at Module._compile (module.js:570:32)

可以在&{34; feature / auth&#34;下的BioanApp/bioan-server Github Repository找到存储库。分支。

我在这里做错了吗?还有其他示例,他们使用import passport from 'passport'语法,甚至使用require('passport')提供相同的错误。

0 个答案:

没有答案