我正在使用 neo4j-driver 通过 nodejs 连接到 neo4j 但我遇到了一个问题。
即使数据库已启动并运行并且可以通过 neo4j 浏览器访问,它也会出现无法连接到服务器的错误。
Neo4jError: Failed to connect to server. Please ensure that your database is listening on
the correct host and port and that you have compatible encryption settings both on
Neo4j server and driver. Note that the default encryption setting has changed in
Neo4j 4.0. Caused by: connect ECONNREFUSED 127.0.0.1:7687
at captureStacktrace (/mnt/d/Codes/SIMply/server/node_modules/neo4j-driver/lib/result.js:277:15)
at new Result (/mnt/d/Codes/SIMply/server/node_modules/neo4j-driver/lib/result.js:68:19)
at Session._run (/mnt/d/Codes/SIMply/server/node_modules/neo4j-driver/lib/session.js:174:14)
at Session.run (/mnt/d/Codes/SIMply/server/node_modules/neo4j-driver/lib/session.js:135:19)
at /mnt/d/Codes/SIMply/server/database/randProviderdata.js:25:19
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
code: 'ServiceUnavailable',
name: …
Run Code Online (Sandbox Code Playgroud)