davidtsai / node-geoip2

Maxmind GeoIP2 database reader for geolocating ip addresses.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot Install on Linux Mint (Ubuntu Trusty) 64bit

YOMorales opened this issue · comments

Hello!

First of all, thank you for developing this module. When I saw it, I was happy that it used Maxmind's C lib for faster lookups, and that it is supposed to use the commercial versions of the mmdb files!
But I tried several times to install (both as sudo and regular user) and it failed. A friend also tried to install on his local machine and it failed.
Here is the console output (this was for an occasion that I tried to install as sudo):

> node-geoip2@0.9.5 install /usr/local/lib/node_modules/node-geoip2
> node-gyp rebuild

make: Entering directory `/usr/local/lib/node_modules/node-geoip2/build'
  CC(target) Release/obj.target/libmaxminddb/deps/libmaxminddb/src/maxminddb.o
  AR(target) Release/obj.target/deps/maxminddb.a
  COPY Release/maxminddb.a
  CXX(target) Release/obj.target/node_mmdb/src/node_mmdb.o
In file included from ../src/node_mmdb.h:6:0,
                 from ../src/node_mmdb.cpp:2:
../node_modules/nan/nan.h:261:25: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                         ^
../node_modules/nan/nan.h:256:25: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                         ^
../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:672:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../src/node_mmdb.h:6,
                 from ../src/node_mmdb.cpp:2:
/home/yamir/.node-gyp/3.2.0/include/node/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Handle<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/yamir/.node-gyp/3.2.0/include/node/node_buffer.h:31:40: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/yamir/.node-gyp/3.2.0/include/node/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/yamir/.node-gyp/3.2.0/include/node/node_buffer.h:43:40: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/node_mmdb.h:6:0,
                 from ../src/node_mmdb.cpp:2:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:676:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/node_mmdb/src/node_mmdb.o] Error 1
make: Leaving directory `/usr/local/lib/node_modules/node-geoip2/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:269:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.13.0-37-generic
gyp ERR! command "/usr/local/bin/iojs" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/node-geoip2
gyp ERR! node -v v3.2.0
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok 
npm ERR! Linux 3.13.0-37-generic
npm ERR! argv "/usr/local/bin/iojs" "/usr/local/bin/npm" "install" "-g" "node-geoip2"
npm ERR! node v3.2.0
npm ERR! npm  v2.13.3
npm ERR! code ELIFECYCLE

npm ERR! node-geoip2@0.9.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-geoip2@0.9.5 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-geoip2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-geoip2
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/yamir/{directory path hidden by me}/npm-debug.log

This looks to be a problem with newer nodejs 4.x or ios.js. We're still running nodejs 0.12.x in our environment.

Updated support for nodejs 4.x. Give 0.10.1 a try and see if it works!

Gonna try it on Monday and see if it works. THANK YOU!

Btw, it worked quite well! Thanks.

It fails on windows. It gives similar error to the above