idb-connector - dbconn is not a constructor


(jogi) #1

i try to get the sample from the idb-connector site to run.
the idb-connector is installed.
if copy the sample in a test.js and store it in the ifs.
then i call “qp2term” and navigate to the ifs-folder where the js-file ist stored.
i install idb-connector with “npm i idb-connector” and run the file.
const {dbconn, dbstmt} = require('idb-connector');
const sSql = 'SELECT STATE FROM QIWS.QCUSTCDT';
const connection = new dbconn();
the scripts fails with the the error : TypeError: dbconn is not a constructor
node - v6.14.4
npm - 3.10.10
ibm os 7.2


(John Gee) #2

(Moved to #community:javascript. As this is an npm focused forum, you may get better answers by asking somewhere focused on idb-connector.)

I did find a report of same issue, but the reporter did not solve it on their original system: https://bitbucket.org/litmis/nodejs-idb-connector/issues/17/dbdbconn-is-not-a-constructor


(jogi) #3

Hi,

i installed node 10 via yum and now the error is gone !


(system) closed #4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.