Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.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 使用unix文件套接字从nodejs连接到arangodb3_Node.js_Arangodb_Arangojs - Fatal编程技术网

Node.js 使用unix文件套接字从nodejs连接到arangodb3

Node.js 使用unix文件套接字从nodejs连接到arangodb3,node.js,arangodb,arangojs,Node.js,Arangodb,Arangojs,我正在尝试在GentooLinux上使用Nodejs 7.5.0和unix文件套接字连接到arangodb3 我在/tmp/mysocket处使用unix套接字启动arrangodb3服务器 我尝试了两个不同的模块: const arangojs = require('arangojs'); let db = arangojs({ url: `unix:///tmp/mysocket`, databaseName: false // don't automatically appe

我正在尝试在GentooLinux上使用Nodejs 7.5.0和unix文件套接字连接到arangodb3

我在/tmp/mysocket处使用unix套接字启动arrangodb3服务器

我尝试了两个不同的模块:

const arangojs = require('arangojs');

let db = arangojs({
  url: `unix:///tmp/mysocket`,
    databaseName: false // don't automatically append database path to URL
    });

db.createDatabase('mydb', function (err, info) {
    if (err) console.error(err.stack);
    else {
    console.info('database created');
        // database created
    }
});
这给了我:

Error: connect ECONNREFUSED ::1:80
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
Error: Cannot find module 'unix'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Xhr (/home/ufk/work-projects/bingo/arrango/node_modules/arango/lib/xhr.js:23:12)
    at Arango.request (/home/ufk/work-projects/bingo/arrango/node_modules/arango/lib/arango.js:166:2)
    at Arango.(anonymous function) [as get] (/home/ufk/work-projects/bingo/arrango/node_modules/arango/lib/arango.js:204:14)
    at Object.list (/home/ufk/work-projects/bingo/arrango/node_modules/arango/lib/api/collection/index.js:125:16)
    at Object.instance.(anonymous function) [as list] (/home/ufk/work-projects/bingo/arrango/node_modules/arango/lib/api/api.js:121:25)
    at Object.<anonymous> (/home/ufk/work-projects/bingo/arrango/index2.js:5:16)
因此,它尝试连接到本地主机端口80,忽略我的unix套接字文件位置

我还尝试:

var arango = require('arango');

var db = arango.Connection("unix:///tmp/mysocket");

 db.collection.list().done(function(res){
   console.log("collections: %j", res);
   });
这给了我:

Error: connect ECONNREFUSED ::1:80
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
Error: Cannot find module 'unix'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Xhr (/home/ufk/work-projects/bingo/arrango/node_modules/arango/lib/xhr.js:23:12)
    at Arango.request (/home/ufk/work-projects/bingo/arrango/node_modules/arango/lib/arango.js:166:2)
    at Arango.(anonymous function) [as get] (/home/ufk/work-projects/bingo/arrango/node_modules/arango/lib/arango.js:204:14)
    at Object.list (/home/ufk/work-projects/bingo/arrango/node_modules/arango/lib/api/collection/index.js:125:16)
    at Object.instance.(anonymous function) [as list] (/home/ufk/work-projects/bingo/arrango/node_modules/arango/lib/api/api.js:121:25)
    at Object.<anonymous> (/home/ufk/work-projects/bingo/arrango/index2.js:5:16)
错误:找不到模块“unix”
在Function.Module.\u解析文件名(Module.js:470:15)
在Function.Module.\u加载(Module.js:418:25)
at Module.require(Module.js:498:17)
根据需要(内部/module.js:20:19)
在Xhr(/home/ufk/workprojects/bingo/arrango/node_modules/arango/lib/Xhr.js:23:12)
应Arango.request(/home/ufk/work projects/bingo/arrango/node_modules/Arango/lib/Arango.js:166:2)
在Arango(匿名函数)[as get](/home/ufk/work projects/bingo/arrango/node_modules/Arango/lib/Arango.js:204:14)
在Object.list(/home/ufk/workprojects/bingo/arrango/node_modules/arango/lib/api/collection/index.js:125:16)
at Object.instance.(匿名函数)[as list](/home/ufk/work projects/bingo/arrango/node_modules/arango/lib/api/api.js:121:25)
反对。(/home/ufk/workprojects/bingo/arrango/index2.js:5:16)

我真的不在乎使用哪个模块。。正在寻找支持unix文件套接字的东西。有什么想法吗?

我在arrangojs上打开了一个关于缺少unix文件套接字支持的错误报告。他们回答说不支持。unix://尚不受支持,但nodejs的
http.request
support
socketPath
参数受支持

  • 问题是:
  • socketPath相关文档: