Node.js 无法使用节点js连接嵌入式firebird数据库

Node.js 无法使用节点js连接嵌入式firebird数据库,node.js,firebird,node-firebird,Node.js,Firebird,Node Firebird,我正在为firebird数据库使用节点firebird javascript客户端。我无法使用节点Firebird客户端连接Firebird数据库。我有嵌入式火鸟数据库。我得到以下错误: NodeJS firebird客户端: E:\NodeJS\Firebird\demo.js:20 犯错误; ^未定义 代码: var Firebird = require('node-firebird'); var options = {}; options.host = '127.0.0.1'; opt

我正在为firebird数据库使用节点firebird javascript客户端。我无法使用节点Firebird客户端连接Firebird数据库。我有嵌入式火鸟数据库。我得到以下错误:

NodeJS firebird客户端:

E:\NodeJS\Firebird\demo.js:20 犯错误; ^未定义

代码:

var Firebird = require('node-firebird');

var options = {};

options.host = '127.0.0.1';
options.port = 3050;


options.database = 'E:\\NodeJS\\Firebird\\Firebird_3_0_Embedded\\examples\\empbuild\\EMPLOYEE.FDB';
//options.lowercase_keys = true; // set to true to lowercase keys
options.role = null;            // default
options.pageSize = 4096;        // default when creating database

Firebird.attach(options, function(err, db) {

    if (err)
        console.log("Error :"+err);
        throw err;

 console.log("CONNECT SUCCESSFULLY");

    // db = DATABASE
    db.query('SELECT * FROM user', function(err, result) {
        // IMPORTANT: close the connection
        console.log(result);
        db.detach();
    });
});

有人能告诉我如何使用NodeJS连接嵌入式firebird数据库吗?

在if之后需要使用块。因此,
if(err){log…;throw err;}
当前无条件执行
throw err
,包括未定义
err
时。在JavaScript中,缩进并不重要(与Python相反)。由于打字错误,投票关闭主题。此外,
options.host='127.0.0.1';options.port=3050-这意味着您没有使用嵌入式Firebird,而是使用(或试图使用)在NodeJS进程之外运行并通过TCP/IP v4网络协议连接的成熟独立服务器。