问题
I have been trying to install node-oracle on (Red Hat Enterprise Linux Server release 6.4 (Santiago) ) server .However, I was not successful. I have followed the instructions on the webpage carefully, but when I run "npm install oracle", I get the following error. I will paste the whole outcome of the execution of "npm install oracle" below.
npm http GET https://registry.npmjs.org/oracle
npm http 304 https://registry.npmjs.org/oracle
oracle@0.3.4 install /home/oracle/node_modules/oracle
node-gyp rebuild
make: Entering directory /home/oracle/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/outParam.o
SOLINK_MODULE(target) Release/obj.target/oracle_bindings.node
/usr/bin/ld: cannot find -locci
collect2: ld returned 1 exit status
make: *** [Release/obj.target/oracle_bindings.node] Error 1
make: Leaving directory/home/oracle/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/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess.handle.onexit (childprocess.js:789:12)
gyp ERR! System Linux 2.6.32-358.el6.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/oracle/node_modules/oracle
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
I will be grateful if anyone can help in this. I have tried several ways such as downloading the source code and compiling it again on the server, but I had the similar error again.
Cheers, Abdullah
回答1:
From the error, it seems that you did not set OCI_INCLUDE_DIR/OCI_LIB_DIR env variables
export OCI_HOME=<directory of Oracle instant client>
export OCI_LIB_DIR=$OCI_HOME
export OCI_INCLUDE_DIR=$OCI_HOME/sdk/include
export OCI_VERSION=<the instant client major version number> # Optional. Default is 11.
回答2:
I had a same issue, except I am using ubuntu 10.04 and my installer miss the lnnz11 instead of locci. I set the environment variables, and the pre_install_check.sh reply me that "everything looks dandy", but it did not work.
After that I downloaded the instantclient version 11 instead of 12, and redefined the environment variables and it is working now.
来源:https://stackoverflow.com/questions/19429551/installing-node-oracle-on-red-hat-enterprise-linux-server-release-6-4-santiago