简体   繁体   English

通过jxcore航行时出现护照错误

[英]Passport error when running sails through jxcore

I am trying to protect the code of my sailsjs project with jxp (from jxcore). 我试图用jxp(来自jxcore)保护我的sailsjs项目的代码。
I've created the package successfully and install a bunch of modules (passport is one of them). 我已经成功创建了软件包并安装了许多模块(护照就是其中之一)。 All the installations went fine but when I run the application, I have the following error message: 所有安装均正常,但是当我运行该应用程序时,出现以下错误消息:

luc@venus: /tmp/proj $ ~/Desktop/jx my_package.jx
/private/tmp/proj/config/passport.js.jx:10

    passport.serializeUser(function(user, done) {         ^
TypeError: Object #<Object> has no method 'serializeUser'
at Object.<anonymous> (/private/tmp/proj/config/passport.js.jx:10:14)
at Module._compile (module.js:520:26)
at Object.Module._extensions..jx (module.js:1352:405)
at Module.load (module.js:359:33)
at Function.Module._load (module.js:333:12)
at Module.require (module.js:372:17)
at require (module.js:399:17)
at Object.<anonymous> (/private/tmp/proj/config/passport.js:3:16)
at Module._compile (module.js:520:26)
at Object.Module._extensions..js (module.js:538:10)

Any idea ? 任何想法 ?

UPDATE 更新

When using the last version of jx (beta2), I now have the following error when running jx MYPROJ.jx 当使用最新版本的jx(beta2)时,运行jx MYPROJ.jx时出现以下错误

/Users/luc/proj1/node_modules/sails/node_modules/winston/lib/winston.js.jx:52
winston.loggers = new winston.Container();

You just update it to latest version of JXcore, and it will work fine. 您只需将其更新为最新版本的JXcore,它将可以正常工作。 I just tested a similar case without an issue. 我只是测试了类似的情况而没有问题。

Update 更新资料

It seems that pkginfo module (one of the node modules winston uses), tries to access directory list inside the package which is limited due to protection. 似乎pkginfo模块(winston使用的节点模块之一)试图访问包内的目录列表,该列表由于受到保护而受到限制。

There is an Issue in JXCore which is fixed in upcoming release for circular requires which does winston use. JXCore中有一个问题,该问题已在即将发布的版本中针对Winston使用的循环需求进行了修复。

See https://github.com/Nubisa/jxdocs/issues/123 for more information. 有关更多信息,请参见https://github.com/Nubisa/jxdocs/issues/123

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM