【发布时间】:2018-04-11 17:39:25
【问题描述】:
我正在尝试让客户端会话在 Ubuntu 上运行。但是,每当我运行 nodejs app.js 时,我都会收到此错误。我试图弄清楚发生了什么,但我找不到发生了什么。我在他们的 NPM/Github 网站上阅读了客户端会话信息,但我不知道发生了什么。谁能帮助我或带我到正确的地方?
整个错误:
/home/tom/cookiestut/node_modules/client-sessions/lib/client-sessions.js:548
throw new Error("cannot set up sessions without a secret "+
^
Error: cannot set up sessions without a secret or encryptionKey/signatureKey pair
at clientSessionFactory (/home/tom/cookiestut/node_modules/client-sessions/lib/client-sessions.js:548:11)
at Object.<anonymous> (/home/tom/cookiestut/app.js:34:9)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
【问题讨论】:
-
请添加您的应用程序的一些代码:您如何导入库,初始化它。 Minimal, Complete, and Verifiable example会更好