npm install oracle失败

时间:2015-05-06 20:09:46

标签: node.js oracle ubuntu

我已设置环境变量:

export ORACLE_HOME=/usr/lib/oracle/12.1/client64
export LD_LIBRARY_PATH=$ORACLE_HOME
export DYLD_LIBRARY_PATH=$ORACLE_HOME

我还在ORACLE_HOME中设置了一个软链接,因为包含在这里:

/usr/include/oracle/12.1/client64/

所以:

export OCI_INCLUDE_DIR=$ORACLE_HOME/include/

但是npm install oracle仍然失败 - 我确定这与我的oracle安装设置如何配置有关,但不知道如何解决它。

这是我的错误:

npm WARN package.json banner_test@1.0.0 No description
npm WARN package.json banner_test@1.0.0 No repository field.
npm WARN package.json banner_test@1.0.0 No README data
\
> oracle@0.3.8 install /home/cdcoulon/Desktop/proto/banner_test/node_modules/oracle
> node-gyp rebuild

make: Entering directory `/home/cdcoulon/Desktop/proto/banner_test/node_modules/oracle/build'
  CXX(target) Release/obj.target/oracle_bindings/src/connection.o
  CXX(target) Release/obj.target/oracle_bindings/src/oracle_bindings.o
  CXX(target) Release/obj.target/oracle_bindings/src/executeBaton.o
  CXX(target) Release/obj.target/oracle_bindings/src/reader.o
  CXX(target) Release/obj.target/oracle_bindings/src/statement.o
  CXX(target) Release/obj.target/oracle_bindings/src/outParam.o
  SOLINK_MODULE(target) Release/obj.target/oracle_bindings.node
/usr/bin/ld: cannot find -locci
/usr/bin/ld: cannot find -lclntsh
/usr/bin/ld: cannot find -lnnz12
collect2: error: ld returned 1 exit status
make: *** [Release/obj.target/oracle_bindings.node] Error 1
make: Leaving directory `/home/cdcoulon/Desktop/proto/banner_test/node_modules/oracle/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.13.0-49-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/cdcoulon/Desktop/proto/banner_test/node_modules/oracle
gyp ERR! node -v v0.10.38
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok 

npm ERR! oracle@0.3.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the oracle@0.3.8 install script.
npm ERR! This is most likely a problem with the oracle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls oracle
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-49-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "oracle"
npm ERR! cwd /home/cdcoulon/Desktop/proto/banner_test
npm ERR! node -v v0.10.38
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

1 个答案:

答案 0 :(得分:1)

你正在使用Joe Ferner的'oracle'驱动程序。如果在较新的node-oracledb驱动程序中提供了所需的功能,则应该更容易找到安装。您有Instant Client RPM,因此您无需为node-oracledb设置任何环境变量:只需使用'npm install oracledb'参见https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instrpm