错误:找到无效的缓存选项true。预期的“记忆”

时间:2014-10-31 10:37:36

标签: node.js mongodb hosting

使用rhc tail socialinteractive在cmd中显示此错误 我托管这个网站openhfit我使用swig和模块巩固和摆动模板 指导我解决这个错误

Error: Invalid cache option true found. Expected "memory" or { get: function (ke
    y) { ... }, set: function (key, value) { ... } }.
        at validateOptions (/var/lib/openshift/5453580c500446bfbc000d3c/app-root/run
    time/repo/node_modules/swig/lib/swig.js:113:15)
        at parse (/var/lib/openshift/5453580c500446bfbc000d3c/app-root/runtime/repo/
    node_modules/swig/lib/swig.js:339:5)
        at Object.precompile (/var/lib/openshift/5453580c500446bfbc000d3c/app-root/r
    untime/repo/node_modules/swig/lib/swig.js:486:23)
        at Object.compile (/var/lib/openshift/5453580c500446bfbc000d3c/app-root/runt
    ime/repo/node_modules/swig/lib/swig.js:606:16)
        at Function.exports.swig.render (/var/lib/openshift/5453580c500446bfbc000d3c
    /app-root/runtime/repo/node_modules/consolidate/lib/consolidate.js:246:56)
        at /var/lib/openshift/5453580c500446bfbc000d3c/app-root/runtime/repo/node_mo
    dules/consolidate/lib/consolidate.js:146:25
        at read (/var/lib/openshift/5453580c500446bfbc000d3c/app-root/runtime/repo/n
    ode_modules/consolidate/lib/consolidate.js:91:22)
        at /var/lib/openshift/5453580c500446bfbc000d3c/app-root/runtime/repo/node_mo
    dules/consolidate/lib/consolidate.js:144:9
        at readPartials (/var/lib/openshift/5453580c500446bfbc000d3c/app-root/runtim
    e/repo/node_modules/consolidate/lib/consolidate.js:114:33)
        at View.engine (/var/lib/openshift/5453580c500446bfbc000d3c/app-root/runtime
    /repo/node_modules/consolidate/lib/consolidate.js:139:5)
    GET / 500 4.312 ms - -

1 个答案:

答案 0 :(得分:2)

这是consolidate.js bug,而不是OpenShift bug。

上游已经解决,请参阅: https://github.com/tj/consolidate.js/pull/134

  1. 一旦发布版本大于0.10.0,您需要更新consolidate.js npm包。

  2. 或者您可以使用以下解决方法(suggested by @truongminh):

      

    app.locals.cache ="记忆"