Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在Node js应用程序中集成Neo4j(Heroku)时面临未知的Bolt协议版本_Node.js_Heroku_Neo4j_Bolt_Graphenedb - Fatal编程技术网

Node.js 在Node js应用程序中集成Neo4j(Heroku)时面临未知的Bolt协议版本

Node.js 在Node js应用程序中集成Neo4j(Heroku)时面临未知的Bolt协议版本,node.js,heroku,neo4j,bolt,graphenedb,Node.js,Heroku,Neo4j,Bolt,Graphenedb,我是Neo4j的初学者,我尝试过使用本文档中建议的代码: 但我得到了以下错误: Neo4jError: Unknown Bolt protocol version: 0 at captureStacktrace (C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node_modules\neo4j-driver\lib\result.js:275:15) at new Result (C:\Users\abdsheikh\Documents\

我是Neo4j的初学者,我尝试过使用本文档中建议的代码:

但我得到了以下错误:

Neo4jError: Unknown Bolt protocol version: 0

at captureStacktrace (C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node_modules\neo4j-driver\lib\result.js:275:15)
at new Result (C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node_modules\neo4j-driver\lib\result.js:66:19)
at Session._run (C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node_modules\neo4j-driver\lib\session.js:172:14)
at Session.run (C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node_modules\neo4j-driver\lib\session.js:133:19)
at Object.<anonymous> (C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\neo4j.js:12:33)
Neo4jError:未知螺栓协议版本:0
在captureStacktrace(C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node\u modules\neo4j driver\lib\result.js:275:15)
在新结果中(C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node\u modules\neo4j driver\lib\Result.js:66:19)
在会话中运行(C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node\u modules\neo4j driver\lib\Session.js:172:14)
at Session.run(C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node\u modules\neo4j driver\lib\Session.js:133:19)
反对。(C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\neo4j.js:12:33)
这是我的代码:

const neo4j = require('neo4j-driver')

uri = "bolt+s://<some-secret-url>.dbs.graphenedb.com:24787";
user = ""; //user was here
password = ""; // password was here

const driver = neo4j.driver(uri, neo4j.auth.basic(user, password))
const session = driver.session()

try {
  const resultPromise = session.run('match(c:Conditions) return c.Name');

  resultPromise.then(result => {
    session.close();
     console.log(node.properties);

    driver.close();
  }).catch((error) => {
    console.log(error);
  });

} finally {
  console.log("Bye");
}
const neo4j=require('neo4j-driver'))
uri=“bolt+s://.dbs.graphenedb.com:24787”;
用户=”//用户在这里
密码=”;//密码在这里
const driver=neo4j.driver(uri,neo4j.auth.basic(用户,密码))
const session=driver.session()
试一试{
const resultPromise=session.run('match(c:Conditions)返回c.Name');
resultPromise.then(result=>{
session.close();
console.log(node.properties);
driver.close();
}).catch((错误)=>{
console.log(错误);
});
}最后{
控制台日志(“再见”);
}

该错误表示可能不支持螺栓协议。您使用的是Neo4j版本3.5.x吗。我认为NEO4J4.x系列启用了新的bolt+s协议

尝试将uri更改为:

uri = "bolt://<some-secret-url>.dbs.graphenedb.com:24787";
uri=”bolt://.dbs.graphenedb.com:24787";

在Heroku上使用GrapheneDB运行Neo4j时遇到了同样的问题,我实际上不得不将Neo4j驱动程序从
4.1.0
降级到
4.0.2
,并使用@TomažBratanič提到的
bolt
v1协议
bolt:///code>

GrapheneDB表示,他们目前(2020年6月15日)还不支持
4.1.0
驱动程序

您还可以在此处找到有关使用正确的
螺栓
版本的更多信息