node-geoip2 icon indicating copy to clipboard operation
node-geoip2 copied to clipboard

geoIp2 support for node v10.12.0

Open ashutoshdikshit opened this issue 6 years ago • 5 comments

I recently upgraded the node version and the npm install fails with the following error

make: *** [Release/obj.target/node_mmdb/src/node_mmdb.o] Error 1 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:262:23) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12) gyp ERR! System Darwin 17.7.0 gyp ERR! command "/usr/local/Cellar/node/9.4.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd //geoip2 gyp ERR! node -v v10.12.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok

ashutoshdikshit avatar Oct 17 '18 17:10 ashutoshdikshit

I've same issue too.

It stops installing with deprecations:

$ npm i --save geoip2

> [email protected] install /hidden/node_modules/geoip2
> node-gyp rebuild

  CC(target) Release/obj.target/libmaxminddb/deps/libmaxminddb/src/maxminddb.o
  LIBTOOL-STATIC Release/maxminddb.a
  CXX(target) Release/obj.target/node_mmdb/src/node_mmdb.o
In file included from ../src/node_mmdb.cpp:2:
In file included from ../src/node_mmdb.h:6:
In file included from ../node_modules/nan/nan.h:190:
../node_modules/nan/nan_maybe_43_inl.h:88:15: error: no member
      named 'ForceSet' in 'v8::Object'
  return obj->ForceSet(GetCurrentContext(), key, value...
         ~~~  ^
In file included from ../src/node_mmdb.cpp:2:
In file included from ../src/node_mmdb.h:6:
In file included from ../node_modules/nan/nan.h:196:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:345:28: warning: 
      'New' is deprecated [-Wdeprecated-declarations]
  return v8::StringObject::New(value).As<v8::StringObject>();
                           ^
/Users/num8er/.node-gyp/10.12.0/include/node/v8.h:5052:3: note: 
      'New' has been explicitly marked deprecated here
  V8_DEPRECATED("Use Isolate* version",
  ^
/Users/num8er/.node-gyp/10.12.0/include/node/v8config.h:327:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
In file included from ../src/node_mmdb.cpp:2:
In file included from ../src/node_mmdb.h:6:
../node_modules/nan/nan.h:816:18: warning: 'MakeCallback' is
      deprecated: Use MakeCallback(..., async_context)
      [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/num8er/.node-gyp/10.12.0/include/node/node.h:175:1: note: 
      'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/num8er/.node-gyp/10.12.0/include/node/node.h:91:20: note: 
      expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../src/node_mmdb.cpp:2:
In file included from ../src/node_mmdb.h:6:
../node_modules/nan/nan.h:830:18: warning: 'MakeCallback' is
      deprecated: Use MakeCallback(..., async_context)
      [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/num8er/.node-gyp/10.12.0/include/node/node.h:168:1: note: 
      'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/num8er/.node-gyp/10.12.0/include/node/node.h:91:20: note: 
      expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../src/node_mmdb.cpp:2:
In file included from ../src/node_mmdb.h:6:
../node_modules/nan/nan.h:844:18: warning: 'MakeCallback' is
      deprecated: Use MakeCallback(..., async_context)
      [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/num8er/.node-gyp/10.12.0/include/node/node.h:161:1: note: 
      'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/num8er/.node-gyp/10.12.0/include/node/node.h:91:20: note: 
      expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../src/node_mmdb.cpp:2:
In file included from ../src/node_mmdb.h:6:
../node_modules/nan/nan.h:890:44: warning: 'ToString' is
      deprecated [-Wdeprecated-declarations]
      v8::Local<v8::String> string = from->ToString();
                                           ^
/Users/num8er/.node-gyp/10.12.0/include/node/v8.h:2454:10: note: 
      'ToString' has been explicitly marked deprecated here
  inline V8_DEPRECATED("Use maybe version", Local<Strin...
         ^
/Users/num8er/.node-gyp/10.12.0/include/node/v8config.h:327:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
In file included from ../src/node_mmdb.cpp:2:
In file included from ../src/node_mmdb.h:6:
../node_modules/nan/nan.h:900:27: warning: 'WriteUtf8' is
      deprecated [-Wdeprecated-declarations]
        length_ = string->WriteUtf8(str_, static_cast<i...
                          ^
/Users/num8er/.node-gyp/10.12.0/include/node/v8.h:2658:3: note: 
      'WriteUtf8' has been explicitly marked deprecated here
  V8_DEPRECATED("Use Isolate* version",
  ^
/Users/num8er/.node-gyp/10.12.0/include/node/v8config.h:327:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
In file included from ../src/node_mmdb.cpp:2:
In file included from ../src/node_mmdb.h:6:
../node_modules/nan/nan.h:1457:31: warning: 'MakeCallback' is
      deprecated: Use MakeCallback(..., async_context)
      [-Wdeprecated-declarations]
    return scope.Escape(node::MakeCallback(
                              ^
/Users/num8er/.node-gyp/10.12.0/include/node/node.h:175:1: note: 
      'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/num8er/.node-gyp/10.12.0/include/node/node.h:91:20: note: 
      expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
7 warnings and 1 error generated.

num8er avatar Oct 20 '18 16:10 num8er

seems this repo is dead

sathia-musso avatar Oct 31 '18 20:10 sathia-musso

Upgrading nan does the trick, but the author does not approve the pull requests.

I've published a fixed version to npm you can use in the meantime - https://www.npmjs.com/package/@signatu/geoip2

thovden avatar Nov 02 '18 12:11 thovden

I just installed maxmind geoip library :)

sathia-musso avatar Nov 02 '18 13:11 sathia-musso

Just use this: https://www.npmjs.com/package/maxmind

alkhachatryan avatar Jun 17 '19 10:06 alkhachatryan