Sails Waterline Oracle - 安装sails-oracle-database - 关于oci / version

时间:2018-05-06 13:37:49

标签: sails.js waterline

我正在尝试使用Sails.js的Grails(与Oracle合作)开发人员

我在安装水线oracle适配器时遇到问题。我可以使用独立节点应用程序使用Mac OS复制步骤:

按照https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instosx

的说明操作

我使用以下命令将Oracle基本客户端文件放在〜/ lib文件夹中:cp instantclient_12_2 / {libclntsh.dylib.12.1,libclntshcore.dylib.12.1,libons.dylib,libnnz12.dylib,libociei.dylib}〜/ lib /

在我的节点应用程序中,我可以通过运行来安装oracle加载项:npm install oracledb

然后我可以运行他们提供的示例,例如通过执行" node select1.js"它成功连接到数据库并运行正常等

然后我尝试通过以下方式安装水线oracle适配器:npm install sails-oracle-database

它给出了这个错误:

>oracledb@1.13.1 install /Users/myuser/Documents/node/oracle/node_modules/sails-oracle-database/node_modules/oracledb

>node-gyp rebuild

node-oracledb ERR! Error: Cannot find /opt/oracle/instantclient/libclntsh.dylib
node-oracledb ERR! Error: Do you need to run 'cd /opt/oracle/instantclient && ln -s libclntsh.dylib.* libclntsh.dylib'?
node-oracledb ERR! Error: See https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instosx

gyp: Call to 'INSTURL="https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instosx"; ERR="node-oracledb ERR! Error:"; if [ -z $OCI_LIB_DIR ]; then if [ -f /opt/oracle/instantclient/libclntsh.dylib ]; then echo "/opt/oracle/instantclient/"; else echo "$ERR Cannot find /opt/oracle/instantclient/libclntsh.dylib" >&2; echo "$ERR Do you need to run 'cd /opt/oracle/instantclient && ln -s libclntsh.dylib.* libclntsh.dylib'?" >&2; echo "$ERR See $INSTURL" >&2; echo "" >&2; fi; else if [ -f "$OCI_LIB_DIR/libclntsh.dylib" ]; then echo $OCI_LIB_DIR; else echo "$ERR Cannot find \$OCI_LIB_DIR/libclntsh.dylib" >&2; echo "$ERR Do you need to run 'cd \$OCI_LIB_DIR && ln -s libclntsh.dylib.* libclntsh.dylib'?" >&2; echo "$ERR See $INSTURL" >&2; echo "" >&2; fi; fi;' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)

试图理解错误......看起来它想要我设置env变量,例如:OCI_LIB_DIR 但是,它引用的oracle页面上的指令说oracle-node 2版本不再需要它。 waterline-oracle适配器是否可能与此版本兼容?

1 个答案:

答案 0 :(得分:0)

您还需要oracle即时客户端的SDK包。如果您的即时客户端目录已经有一个“sdk”文件夹,那么您已经设置好了。接下来是将其复制到“/ opt / oracle / instantclient”目录。

➜  instantclient pwd
/opt/oracle/instantclient
➜  instantclient ls
BASIC_README             glogin.sql               libnnz12.dylib           libocijdbc12.dylib       libsqlplusic.dylib       uidrvci
SQLPLUS_README           libclntsh.dylib          libocci.dylib            libons.dylib             ojdbc8.jar               xstreams.jar
adrci                    libclntsh.dylib.12.1     libocci.dylib.12.1       liboramysql12.dylib      sdk
genezi                   libclntshcore.dylib.12.1 libociei.dylib           libsqlplus.dylib         sqlplus