Hi,
I want to send some data from the Raspberry Pi 2 over the network to a SQL server. For that I want to use a ODBC connector for SQL. I'm using Node-red to code this task so I'm trying to install
node-red-contrib-odbc, however I'm having some trouble doing so.
When I run the installation:
npm install node-red-contrib-odbc,
I get the following messages:
----------------------------------------------------------------------------------------------------------------------------------------------------
npm install node-red-contrib-odbc
\
> od...@1.1.6 install /usr/local/lib/node_modules/node-red-contrib-odbc/node_modules/odbc
> node-gyp configure build
make: Entering directory '/usr/local/lib/node_modules/node-red-contrib-odbc/node_modules/odbc/build'
CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Object> ODBC::GetSQLError(SQLSMALLINT, SQLHANDLE, char*)’:
../src/odbc.cpp:884:27: error: call of overloaded ‘NanNew(SQLINTEGER&)’ is ambiguous
../src/odbc.cpp:884:27: note: candidates are:
../node_modules/nan/nan_new.h:258:1: note: NanIntern::FactoryBase<v8::Boolean>::return_t NanNew(bool)
../node_modules/nan/nan_new.h:264:1: note: NanIntern::IntegerFactory<v8::Int32>::return_t NanNew(int32_t)
../node_modules/nan/nan_new.h:270:1: note: NanIntern::FactoryBase<v8::Uint32>::return_t NanNew(uint32_t)
../node_modules/nan/nan_new.h:276:1: note: NanIntern::FactoryBase<v8::Number>::return_t NanNew(double)
../node_modules/nan/nan_new.h:282:1: note: NanIntern::FactoryBase<v8::String>::return_t NanNew(const string&) <near match>
../node_modules/nan/nan_new.h:282:1: note: no known conversion for argument 1 from ‘SQLINTEGER {aka long int}’ to ‘const string& {aka const std::basic_string<char>&}’
../node_modules/nan/nan_new.h:294:1: note: NanIntern::FactoryBase<v8::String>::return_t NanNew(const char*) <near match>
../node_modules/nan/nan_new.h:294:1: note: no known conversion for argument 1 from ‘SQLINTEGER {aka long int}’ to ‘const char*’
../node_modules/nan/nan_new.h:300:1: note: NanIntern::FactoryBase<v8::String>::return_t NanNew(const uint8_t*) <near match>
../node_modules/nan/nan_new.h:300:1: note: no known conversion for argument 1 from ‘SQLINTEGER {aka long int}’ to ‘const uint8_t* {aka const unsigned char*}’
../node_modules/nan/nan_new.h:306:1: note: NanIntern::FactoryBase<v8::String>::return_t NanNew(const uint16_t*) <near match>
../node_modules/nan/nan_new.h:306:1: note: no known conversion for argument 1 from ‘SQLINTEGER {aka long int}’ to ‘const uint16_t* {aka const short unsigned int*}’
../node_modules/nan/nan_new.h:312:1: note: NanIntern::FactoryBase<v8::String>::return_t NanNew(v8::String::ExternalStringResource*) <near match>
../node_modules/nan/nan_new.h:312:1: note: no known conversion for argument 1 from ‘SQLINTEGER {aka long int}’ to ‘v8::String::ExternalStringResource*’
../node_modules/nan/nan_new.h:318:1: note: NanIntern::FactoryBase<v8::String>::return_t NanNew(NanExternalOneByteStringResource*) <near match>
../node_modules/nan/nan_new.h:318:1: note: no known conversion for argument 1 from ‘SQLINTEGER {aka long int}’ to ‘NanExternalOneByteStringResource* {aka v8::String::ExternalAsciiStringResource*}’
odbc_bindings.target.mk:90: recipe for target 'Release/obj.target/odbc_bindings/src/odbc.o' failed
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
make: Leaving directory '/usr/local/lib/node_modules/node-red-contrib-odbc/node_modules/odbc/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 4.0.7+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /usr/local/lib/node_modules/node-red-contrib-odbc/node_modules/odbc
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! od...@1.1.6 install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the od...@1.1.6 install script.
npm ERR! This is most likely a problem with the odbc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls odbc
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.0.7+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node-red-contrib-odbc"
npm ERR! cwd /usr/local/lib/node_modules
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
----------------------------------------------------------------------------------------------------------------------------------------------------
In the requirements it says:
Requirements
- unixODBC binaries and development libraries for module compilation
on Ubuntu/Debian sudo apt-get install unixodbc unixodbc-dev
on OSX using
macports.org sudo port unixODBC
- odbc drivers for target database
- properly configured odbc.ini and odbcinst.ini.
I have already installed the libraries:
sudo apt-get install unixodbc unixodbc-dev , but I don't know where can I get the drivers from and in which way the odbc.ini and odbcint.ini need to be configured. I assume that becasue I haven't been able to do this the installation fails but I'm not sure.
I would appreciate if someone could help me with this