Binary Download and Fallback to Build Fail on Node 8

Issue #43 resolved
David Russo created an issue

I'm having problems installing idb-connector 1.1.3 with Node 8. If I try to install into a new project with no other dependencies I get this output:

#!
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for idb-connector@1.1.3 and node@8.12.0 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error Remote end closed socket abruptly.
node-pre-gyp WARN Pre-built binaries not installable for idb-connector@1.1.3 and node@8.12.0 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error bad download

Looks like 'needle' is unable to download the pre-built binary for some reason. Furthermore, the build fails when it falls back to trying to compile from source code with this:

#!

gyp: /home/drusso/idbtest/node_modules/idb-connector/build/config.gypi not found (cwd: /home/drusso/idbtest/node_modules/idb-connector) while reading includes of binding.gyp while trying to load binding.gyp

An interesting thing I noticed is that if I first install 'request' in my project, the idb-connector installation succeeds. Apparently 'node-pre-gyp' uses 'request' to do the download instead of 'needle";

#!

node-pre-gyp WARN Using request for node-pre-gyp https download
[idb-connector] Success: "/home/drusso/idbtest/node_modules/idb-connector/lib/binding/Release/node-v57-ibmi-ppc64/db2ia.node" is installed via remote

I'm getting this result with Node.js 8.12.0 on IBM i 7.2. The problem does not occur if I use Node.js 10.11.0 on the same system. In that case, 'needle' is able to download the binary and install w/o problems.

Is there some way to correct this problem for Node.js 8 so that it's not necessary to install 'request' first? Maybe request can be included in the idb-connector dependencies?

Comments (4)

  1. mengxumx Account Deactivated

    @DavidRusso Yes, I am investigating this issue. It is weird. On my system, the error occurs if I install idb-connector to the global directory using node 8.12.0 -->

    #!
    
    bash-4.4$ npm -g i idb-connector
    
    > idb-connector@1.1.3 install /QOpenSys/pkgs/lib/nodejs8/lib/node_modules/idb-connector
    > node-pre-gyp install --fallback-to-build
    
    node-pre-gyp WARN Using needle for node-pre-gyp https download
    node-pre-gyp WARN Pre-built binaries not installable for idb-connector@1.1.3 and node@8.12.0 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
    

    But it works fine if I simply use the 'local' install -->

    #!
    bash-4.4$ npm i idb-connector
    
    > idb-connector@1.1.3 install /home/xumeng/test/getimg/node_modules/idb-connector
    > node-pre-gyp install --fallback-to-build
    
    node-pre-gyp WARN Using request for node-pre-gyp https download
    [idb-connector] Success: "/home/xumeng/test/getimg/node_modules/idb-connector/lib/binding/Release/node-v57-ibmi-ppc64/db2ia.node" is installed via remote
    

    While node 10 and previous node 8 versions have no such a issue.

  2. mengxumx Account Deactivated

    I am afraid that it is a node-pre-gyp issue. So I updated the node-pre-gyp version to 0.11.0 in idb-connector v1.1.4. On my dev system, the 'needle' issue has gone. Would you try the new version?

  3. Log in to comment