zoukankan      html  css  js  c++  java
  • express 4.0 connect-mongo 运行时报错

    

    app.use(session({
        secret: settings.cookieSecret,
        key: settings.db,//cookie name
        cookie: {maxAge: 1000 * 60 * 60 * 24 * 30},//30 days
        store: new MongoStore({
            //url: 'mongodb://localhost/db'
            db: settings.db,
            host: settings.host,
            port: settings.port
        })
    }));


    C:workWebStorm11in unnerw.exe C:work odejs_v4_4_4 ode.exe binwww
    c:UsersAdministratorWebstormProjectslog ode_modulesconnect-mongosrcindex.js:105
                    throw new Error('Connection strategy not found');
                    ^

    Error: Connection strategy not found
        at MongoStore (c:UsersAdministratorWebstormProjectslog ode_modulesconnect-mongosrcindex.js:105:23)
        at Object.<anonymous> (c:UsersAdministratorWebstormProjectslogapp.js:31:12)
        at Module._compile (module.js:409:26)
        at Object.Module._extensions..js (module.js:416:10)
        at Module.load (module.js:343:32)
        at Function.Module._load (module.js:300:12)
        at Module.require (module.js:353:17)
        at require (internal/module.js:12:17)
        at Object.<anonymous> (c:UsersAdministratorWebstormProjectsloginwww:7:11)
        at Module._compile (module.js:409:26)
        at Object.Module._extensions..js (module.js:416:10)
        at Module.load (module.js:343:32)
        at Function.Module._load (module.js:300:12)
        at Function.Module.runMain (module.js:441:10)
        at startup (node.js:139:18)
        at node.js:968:3

    Process finished with exit code 1


    修改为

    store: new MongoStore({
        url: 'mongodb://localhost/db'
        //db: settings.db,
        //host: settings.host,
        //port: settings.port
    })

  • 相关阅读:
    WPF-触发器
    WPF使用socket实现简单聊天软件
    git常用命令备忘
    (转载)WPF中的动画——(一)基本概念
    WPF中的依赖项属性
    C#中的索引器
    C#中的装箱拆箱
    编程语言的弱类型、强类型、动态类型、静态类型
    WPF中的数据驱动
    WPF中的命令简介
  • 原文地址:https://www.cnblogs.com/zaifeng0108/p/7225047.html
Copyright © 2011-2022 走看看