我一般都使用Neo4j,但http连接器上的Neo4j CE 3.1浏览器运行非常顺畅。现在我需要使用JavaScript来开发图形可视化,而驱动程序根本不工作。我下载了neo4j-javascript-driver-1.1,和 npm安装 npm WARN可选SKIPPING OPTIONAL DEPENDENCY:fsevents@^1.0.0(node_modules \ chokidar \ node_modules \ fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY:不支持的fsevents@1.0.15平台:想要{“os”:“darwin”,“arch”:“any”}(当前:{“os”:“win32”,“arch”: “64”})
npm build (fine)
npm test (problems)
我所能理解的是需要配置螺栓连接器,因此我添加到配置文件中以启用螺栓连接。这使无法连接的消息消失了。现在我遇到了这个问题:
npm test
> neo4j-driver@1.1.0-dev test C:\neo4j-javascript-driver-1.1\neo4j-javascript-driver-1.1
> gulp test
[15:00:37] Using gulpfile (node:9436) DeprecationWarning: `DEBUG_FD` is deprecated. Override `debug.log` if you want to use a different log function (https://git.io/vMUyr)
C:\neo4j-javascript-driver-1.1\neo4j-javascript-driver-1.1\gulpfile.js
[15:00:37] Starting 'test'...
[15:00:37] Starting 'nodejs'...
[15:00:39] Finished 'nodejs' after 1.86 s
[15:00:39] Starting 'test-nodejs'...
................Structure {
signature: 127,
fields:
[ { code: 'Neo.ClientError.Security.Unauthorized',
message: 'The client is unauthorized due to authentication failure.' } ] }
FF...........FF.............F(node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: This socket has been ended by the other party
(node:9436) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: This socket has been ended by the other party
F(node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): Error: This socket has been ended by the other party
(node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): Error: This socket has been ended by the other party
F(node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 7): Error: This socket has been ended by the other party
(node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 8): Error: This socket has been ended by the other party
F(node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 10): Error: This socket has been ended by the other party
(node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 11): Error: This socket has been ended by the other party
F(node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 13): Error: This socket has been ended by the other party
(node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 14): Error: This socket has been ended by the other party
C:\neo4j-javascript-driver-1.1\neo4j-javascript-driver-1.1\test\v1\examples.test.js:195
expect(out[0].length).toBe(3);
^
TypeError: Cannot read property 'length' of undefined
at Timeout._onTimeout (C:\neo4j-javascript-driver-1.1\neo4j-javascript-driver-1.1\test\v1\examples.test.js:195:20)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
npm ERR! Test failed. See above for more details.
Process finished with exit code 1
我在Windows 10命令提示符下尝试了这个,并从WebStorm 2016.3.2中获得了相同的响应,
当我尝试localhost时,我也得到以下响应:7687,因为我收到了无法连接的错误
not a WebSocket handshake request: missing upgrade
我想这是因为它通过http连接,而这个端口是一个只通过驱动程序运行的螺栓连接。
我对localhost:7474浏览器的http连接(用户名和密码)进行了身份验证,感谢您提供有关如何为螺栓连接配置身份验证的帮助,
提前感谢,
答案 0 :(得分:1)
从错误中可以看出,您用于登录neo4j的用户名和密码是错误的:
[ { code: 'Neo.ClientError.Security.Unauthorized',
message: 'The client is unauthorized due to authentication failure.' } ]