将 oracle 数据库与节点连接时出错
Error connect oracle database with node
我对 'node-oracledb' library.its 尝试连接到本地数据库的简单文件有疑问。
环境:centos 6.4 / nodejs v0.12.2 / oracle库node-oracledb 0.3.8
来自 .bash_profile 的环境变量:
export ORACLE_BASE=/usr/oracle/app export ORACLE_SID=orcl export
ORACLE_HOME=/usr/oracle/app/product/11.2.0/dbhome_1 export
OCI_LIB_DIR=$ORACLE_HOME/lib export
OCI_INC_DIR=$ORACLE_HOME/rdbms/public
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
var oracle = require('oracle');
var connectData = {
hostname: "localhost",
port: 1521,
database: "orcl", // System ID (SID)
user: "scott",
password: "oracle"
}
错误:
.错误:找不到模块'../build/Release/oracle_bindings'
在 Function.Module._resolveFilename (module.js:336:15)
在 Function.Module._load (module.js:278:25)
在 Module.require (module.js:365:17)
在需要时(module.js:384:17)
在对象。 (/usr/oracle/dev/atlantisSGBD/node_modules/oracle/lib/oracle.js:2:16)
在 Module._compile (module.js:460:26)
在 Object.Module._extensions..js (module.js:478:10)
在 Module.load (module.js:355:32)
在 Function.Module._load (module.js:310:12)
在 Module.require (module.js:365:17)
看来您正在使用未维护的 oracle
module. You might consider switching to Oracle's oracledb
module。
如果这不是一个可行的解决方案:它在 oracle
的安装过程中似乎是通过 gyp 安装了它在查找 (oracle_bindings
) 时遇到问题的模块。因此,请尝试再次安装它并特别注意该部分是否成功。
此外,请注意 the installation instructions for oracle
比典型的 Node.js 模块更广泛。确保您设置了它需要的所有环境变量,并将它们设置为正确的值。 (在您的代码中,检查 process.env
对象中的值。)确保您已成功安装说明要求您安装的所有内容。
我对 'node-oracledb' library.its 尝试连接到本地数据库的简单文件有疑问。 环境:centos 6.4 / nodejs v0.12.2 / oracle库node-oracledb 0.3.8 来自 .bash_profile 的环境变量:
export ORACLE_BASE=/usr/oracle/app export ORACLE_SID=orcl export ORACLE_HOME=/usr/oracle/app/product/11.2.0/dbhome_1 export OCI_LIB_DIR=$ORACLE_HOME/lib export OCI_INC_DIR=$ORACLE_HOME/rdbms/public LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
var oracle = require('oracle');
var connectData = {
hostname: "localhost",
port: 1521,
database: "orcl", // System ID (SID)
user: "scott",
password: "oracle"
}
错误: .错误:找不到模块'../build/Release/oracle_bindings' 在 Function.Module._resolveFilename (module.js:336:15) 在 Function.Module._load (module.js:278:25) 在 Module.require (module.js:365:17) 在需要时(module.js:384:17) 在对象。 (/usr/oracle/dev/atlantisSGBD/node_modules/oracle/lib/oracle.js:2:16) 在 Module._compile (module.js:460:26) 在 Object.Module._extensions..js (module.js:478:10) 在 Module.load (module.js:355:32) 在 Function.Module._load (module.js:310:12) 在 Module.require (module.js:365:17)
看来您正在使用未维护的 oracle
module. You might consider switching to Oracle's oracledb
module。
如果这不是一个可行的解决方案:它在 oracle
的安装过程中似乎是通过 gyp 安装了它在查找 (oracle_bindings
) 时遇到问题的模块。因此,请尝试再次安装它并特别注意该部分是否成功。
此外,请注意 the installation instructions for oracle
比典型的 Node.js 模块更广泛。确保您设置了它需要的所有环境变量,并将它们设置为正确的值。 (在您的代码中,检查 process.env
对象中的值。)确保您已成功安装说明要求您安装的所有内容。