npm install ldapauth 安装报错, node LDAP 验证谁做过啊 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
nuc093

npm install ldapath 安装报错, node LDAP 验证谁做过啊

  •  
  •   nuc093 2015 年 9 月 8 日 4134 次点击
    这是一个创建于 3882 天前的主题,其中的信息可能已经有所发展或是发生改变。

    mytodos git:(master ) npm install ldapauth

    [email protected] install /home/raphael/dev/mytodos/node_modules/ldapauth/node_modules/bcrypt
    node-gyp rebuild

    make: Entering directory '/home/raphael/dev/mytodos/node_modules/ldapauth/node_modules/bcrypt/build'
    CXX (target ) Release/obj.target/bcrypt_lib/src/blowfish.o
    CXX (target ) Release/obj.target/bcrypt_lib/src/bcrypt.o
    CXX (target ) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
    ../src/bcrypt_node.cc: In destructor ‘ virtual {anonymous}::baton_base::~baton_base ()’:
    ../src/bcrypt_node.cc:118:18: error: ‘ class v8::Persistent<v8::Function>’ has no member named ‘ Dispose ’
    callback.Dispose ();
    ^
    ../src/bcrypt_node.cc: At global scope:
    ../src/bcrypt_node.cc:198:19: error: variable or field ‘ GenSaltAsync ’ declared void
    void GenSaltAsync (uv_work_t* req ) {
    ^
    ../src/bcrypt_node.cc:198:19: error: ‘ uv_work_t ’ was not declared in this scope
    ../src/bcrypt_node.cc:198:30: error: ‘ req ’ was not declared in this scope
    void GenSaltAsync (uv_work_t* req ) {
    ^
    ../src/bcrypt_node.cc:483:30: error: expected ‘}’ at end of input
    NODE_MODULE (bcrypt_lib, init );
    ^
    ../src/bcrypt_node.cc:85:13: warning: ‘ void crypto_lock_init ()’ defined but not used [-Wunused-function]
    static void crypto_lock_init (void ) {
    ^
    ../src/bcrypt_node.cc:95:13: warning: ‘ void crypto_lock_cb (int, int, const char, int )’ defined but not used [-Wunused-function]
    static void crypto_lock_cb (int mode, int n, const char
    file, int line ) {
    ^
    ../src/bcrypt_node.cc:105:22: warning: ‘ long unsigned int crypto_id_cb ()’ defined but not used [-Wunused-function]
    static unsigned long crypto_id_cb (void ) {
    ^
    ../src/bcrypt_node.cc:140:5: warning: ‘ int {anonymous}::GetSeed (uint8_t, int )’ defined but not used [-Wunused-function]
    int GetSeed (uint8_t
    seed, int size ) {
    ^
    ../src/bcrypt_node.cc:150:6: warning: ‘ bool {anonymous}::ValidateSalt (const char)’ defined but not used [-Wunused-function]
    bool ValidateSalt (const char
    salt ) {
    ^
    bcrypt_lib.target.mk:88: recipe for target 'Release/obj.target/bcrypt_lib/src/bcrypt_node.o' failed
    make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
    make: Leaving directory '/home/raphael/dev/mytodos/node_modules/ldapauth/node_modules/bcrypt/build'
    gyp ERR! build error
    gyp ERR! stack Error: make failed with exit code: 2
    gyp ERR! stack at ChildProcess.onExit (/home/raphael/.nvm/versions/node/v0.12.4/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23 )
    gyp ERR! stack at ChildProcess.emit (events.js:110:17 )
    gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12 )
    gyp ERR! System Linux 3.19.0-15-generic
    gyp ERR! command "node" "/home/raphael/.nvm/versions/node/v0.12.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/raphael/dev/mytodos/node_modules/ldapauth/node_modules/bcrypt
    gyp ERR! node -v v0.12.4
    gyp ERR! node-gyp -v v1.0.3
    gyp ERR! not ok

    7 条回复    2015-09-09 16:23:09 +08:00
    jarlyyn
        1
    jarlyyn  
       2015 年 9 月 8 日
    jarlyyn
        2
    jarlyyn  
       2015 年 9 月 8 日
    User.prototype.getLdapClient=function ()
    {
    var web=this.web;
    return ldap.createClient (web.settings.ldap );
    }

    User.prototype.auth=function (uid,password,callback )
    {
    var User=this;
    this.getLdapClient ().bind ('uid='+uid+',ou=People,dc=xxxx',password,function (err ){
    if (err ){return callback (err,null )}
    User.find (uid,function (err,result ){
    if (err ){return callback (err,null )}
    callback (null,result );
    });
    });
    }

    大概是这样的。
    nuc093
        3
    nuc093  
    OP
       2015 年 9 月 8 日
    @jarlyyn 多谢我来研究研究
    scarlex
        4
    scarlex  
       2015 年 9 月 8 日
    目测是 bcrypt 的问题, 0.7.5 只能用 Node 0.10.x
    楼主的 Node 是 0.12 吧,降到 0.10 试试
    nuc093
        5
    nuc093  
    OP
       2015 年 9 月 8 日
    @scarlex ok 试一试
    nuc093
        7
    nuc093  
    OP
       2015 年 9 月 9 日
    var ldap = require ('ldapjs');
    var client = ldap.createClient ({
    url: 'ldap://192.168.96.23:389'
    });
    client.bind ('cn=admin,dc=ds,dc=com', 'linux', function (err ) {
    assert.ifError (err );
    });
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2673 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 61ms UTC 07:14 PVG 15:14 LAX 00:14 JFK 03:14
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86