loopback odbc_bindings.node未找到图像

时间:2017-08-16 10:27:30

标签: loopback dashdb

我正在尝试在Loopback项目上设置DashDB数据源。

我正在运行节点-v 6.10.1& npm -v 3.10.10

尝试初始化新的Dashdb数据源时出现以下错误:

npm ERR! argv "/Users/bannastre/.nvm/versions/node/v6.10.1/bin/node" "/Users/bannastre/.nvm/versions/node/v6.10.1/bin/npm" "install" "loopback-connector-dashdb@^1.0.0" "--save"
npm ERR! node v6.10.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! ibm_db@1.0.2 install: `node installer/driverInstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ibm_db@1.0.2 install script 'node installer/driverInstall.js'.

所以我尝试使用npm install loopback-connector-dashdb --save设置环回连接器,运行正常。

当我尝试运行应用程序时,我收到错误消息。看起来好像是odbc_bindings.node文件或libdb2.dylib

当我运行node .时,会抛出以下错误:

Error: dlopen(../projects/loopback-getting-started/node_modules/ibm_db/build/Release/odbc_bindings.node, 1): Library not loaded: ../projects/loopback-getting-started/node_modules/ibm_db/installer/clidriver/lib/libdb2.dylib
  Referenced from: ../projects/loopback-getting-started/node_modules/ibm_db/build/Release/odbc_bindings.node
  Reason: image not found
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at bindings (../projects/loopback-getting-started/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (../projects/loopback-getting-started/node_modules/ibm_db/lib/odbc.js:27:31)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

我错过了一个包吗?

2 个答案:

答案 0 :(得分:0)

这看起来像是本机节点问题。您可以尝试从应用程序运行以下命令:

npm cache clean && npm install

答案 1 :(得分:0)

原来它与路径中有空格有关(它位于〜/ Google Drive / projects路径上) - ibm_db包Release / Makefile无法处理

这里提出了一个问题: Using Make $(dir) or $(notdir) on a path with spaces