Search code examples
node.jsinformix

Confusing install error with ifxnjs in Node 10


Running a project's npm install on the official node:10 docker image quits with a confusing build error. I can provide other details, but I don't know what's relevant.

../src/odbc.cpp: In static member function 'static v8::Local<v8::Value> ODBC::GetSQLError(SQLSMALLINT, SQLHANDLE, char*)':
../src/odbc.cpp:1184:87: error: no matching function for call to 'v8::Object::SetPrototype(v8::Local<v8::Value>)'
       objError->SetPrototype(Exception::Error(Nan::New(errorMessage).ToLocalChecked()));
                                                                                       ^
In file included from ../src/odbc.cpp:21:0:
/root/.node-gyp/10.15.3/include/node/v8.h:3442:37: note: candidate: v8::Maybe<bool> v8::Object::SetPrototype(v8::Local<v8::Context>, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT Maybe<bool> SetPrototype(Local<Context> context,
                                     ^~~~~~~~~~~~
/root/.node-gyp/10.15.3/include/node/v8.h:3442:37: note:   candidate expects 2 arguments, 1 provided
make: *** [Release/obj.target/ifx_njs_bind/src/odbc.o] Error 1
ifx_njs_bind.target.mk:113: recipe for target 'Release/obj.target/ifx_njs_bind/src/odbc.o' failed
make: Leaving directory '/usr/src/app/node_modules/ifxnjs-aa64/build'

SOLVED: By switching to a project dependency of sails-informix instead of sails-informix2, the docker build finished without errors. The build installed ifxnjs instead of "ifxnjs-aa64".

It appears that the author forked some modules months ago. I haven't installed these before, so I wasn't aware of the differences.


Solution

  • I am curious to know the docker VM platform. The Informix node.js 10.x driver is already available with NPM for Linux64, Win64 and ARM, if you are on one of the platform then you don’t need a local build of driver native components. Due to some reason, it is kick starting the local build of Informix node.js driver native components, (local build need bit more setup than a usual driver install). If local build is not you are intent to do then you may investigate why your environment is initiating the build rather than just fetching the binaries from NPM package manager. Can you try installing just the Informix node.js driver, it can be done by using the following command.

    npm install ifxnjs
    

    Once the driver install has success then you may do the "npm install" you were trying it out for whatever the reason.