【发布时间】:2018-05-06 13:37:49
【问题描述】:
我是一名 Grails(使用 Oracle)开发人员,正在试验 Sails.js
我在安装水线 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 installsails-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)
试图理解错误...看起来它希望我设置环境变量,例如:OCI_LIB_DIR 但是,它引用的 oracle 页面上的说明说,对于 oracle-node 2 版本不再需要。 waterline-oracle 适配器是否可能与此版本不兼容?
【问题讨论】: