1

I'm trying to set up a DashDB datasource on a Loopback project.

I am running node -v 6.10.1 & npm -v 3.10.10

I get the following error when trying to initialize a new Dashdb datasource:

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'.

So I try setting the loopback connector using npm install loopback-connector-dashdb --save, which runs ok.

When I try and run the app I get an error. It looks like this beause of the odbc_bindings.node file or libdb2.dylib.

When I run node . the following error is thrown:

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)

Am I missing a package?

bannastre
  • 11
  • 1

2 Answers2

0

This looks like a native node issue. Could you try running the following command from your app:

npm cache clean && npm install
0

Turns out it's to do with having a space in the path (It's on a ~/Google Drive/projects path) - The ibm_db package Release/Makefile can't handle that

There's an issue raised here: Using Make $(dir) or $(notdir) on a path with spaces

bannastre
  • 11
  • 1