我正在尝试运行包含与Oracle数据库连接的NodeJS(v0.10.36)文件。
当我尝试运行项目时,出现以下错误。
M1318657:testOracle yogeshJC$ node app.js
module.js:340
throw err;
^
Error: Cannot find module '../build/Release/oracle_bindings'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/yogeshJC/testOracle/node_modules/oracle/lib/oracle.js:2:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
app.js包含连接Oracle数据库的简单脚本。
我已按照此处的说明安装oracledb
Oracle版本:11.2
已设置以下环境:
OCI_HOME
OCI_INC_DIR
OCI_VERSION
OCI_LIB_DIR
任何解决问题的线索都将受到赞赏。
编辑:
sudo npm install oracledb
M1318657:testOracle yogeshJC$ sudo npm install oracledb
Password:
npm WARN package.json appdynamics@4.1.10 No repository field.
npm WARN package.json express-namespace@0.1.1 No repository field.
|
> oracledb@1.9.3 install /Users/yogeshJC/testOracle/node_modules/oracledb
> node-gyp rebuild
CXX(target) Release/obj.target/oracledb/src/njs/src/njsOracle.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsPool.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsConnection.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsResultSet.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsMessages.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsIntLob.o
../src/njs/src/njsIntLob.cpp:1222:3: warning: cannot refer to a non-static member from the handler of a constructor function try block [-Wexceptions]
cleanup();
^
1 warning generated.
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnv.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnvImpl.o
../src/dpi/src/dpiEnvImpl.cpp:114:3: warning: cannot refer to a non-static member from the handler of a constructor function try block [-Wexceptions]
cleanup();
^
1 warning generated.
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiException.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiExceptionImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiConnImpl.o
../src/dpi/src/dpiConnImpl.cpp:100:3: warning: cannot refer to a non-static member from the handler of a constructor function try block [-Wexceptions]
cleanup();
^
../src/dpi/src/dpiConnImpl.cpp:139:3: warning: cannot refer to a non-static member from the handler of a constructor function try block [-Wexceptions]
cleanup ();
^
2 warnings generated.
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiDateTimeArrayImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiPoolImpl.o
../src/dpi/src/dpiPoolImpl.cpp:145:3: warning: cannot refer to a non-static member from the handler of a constructor function try block [-Wexceptions]
cleanup();
^
1 warning generated.
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiStmtImpl.o
../src/dpi/src/dpiStmtImpl.cpp:121:3: warning: cannot refer to a non-static member from the handler of a constructor function try block [-Wexceptions]
cleanup ();
^
1 warning generated.
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiUtils.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiLob.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiCommon.o
SOLINK_MODULE(target) Release/oracledb.node
SOLINK_MODULE(target) Release/oracledb.node: Finished
oracledb@1.9.3 node_modules/oracledb
└── nan@2.3.4
答案 0 :(得分:0)
你有一些冲突。您粘贴的错误是指node_modules/oracle
,这是Oracle DB较旧的,不受支持的模块,而不是您显示的oracledb
模块。
建议:
oracle
模块oracledb
模块。OCI_VERSION
或OCI_HOME
oracledb