gpt4 book ai didi

javascript - 无法使用 RedisStore 和 Node.js 读取属性 'Store'

转载 作者:可可西里 更新时间:2023-11-01 11:31:01 29 4
gpt4 key购买 nike

当我尝试运行我的 Node.js 应用程序时遇到以下错误:

Starting child process with 'node ./app.js'
C:\Users\Julian\OneDrive\Documents\Websites\Node\node_modules\connect-redis\lib\connect-redis.js:33
var Store = connect.session.Store;
^

TypeError: Cannot read property 'Store' of undefined
at module.exports (C:\Users\Julian\OneDrive\Documents\Websites\Node\node_modules\connect-redis\lib\connect-redis.js:33:30)
at Object.<anonymous> (C:\Users\Julian\OneDrive\Documents\Websites\Node\app.js:9:42)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
Program node ./app.js exited with code 1

Starting child process with 'node ./app.js'
Received SIGINT, killing child process...
Parent process exiting, terminating child...
Terminate batch job (Y/N)? y

我的package.json文件如下:

{
"name": "NodeChat",
"version": "0.0.0",
"main": "app.js",
"scripts": {
"stop": "echo not implemented",
"start": "supervisor ./app.js"
},
"dependencies": {
"connect-flash": "0.1.1",
"connect-redis": "1.4.7",
"cookie-parser": "1.4.3",
"ejs": "0.8.5",
"express": "4.6.1",
"express-partials": "0.2.0",
"express-session": "1.14.2",
"redis": "0.10.1"
}
}

我认为这可能是兼容性问题,但我相信我运行的是 connect-redis@1.4.7 的兼容版本。我有一个正在运行的 Redis 实例。

最佳答案

将 "connect-redis": "1.4.7"更新到 1.5.0 解决了我的问题。

关于javascript - 无法使用 RedisStore 和 Node.js 读取属性 'Store',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40378824/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com