kuno / GeoIP

GeoIP binding for nodejs(>=0.10) and iojs
GNU Lesser General Public License v2.1
414 stars 129 forks source link

Error installing using npm #22

Closed dip00dip closed 13 years ago

dip00dip commented 13 years ago

node -v v0.5.10-pre npm -v 1.0.99

    ../src/netspeed.cc: In static member function ‘static v8::Handle<v8::Value> geoip::NetSpeed::lookup(const v8::Arguments&)’:
    ../src/netspeed.cc:116: error: invalid conversion from ‘int (*)(eio_req*)’ to ‘void (*)(eio_req*)’
    ../src/netspeed.cc:116: error:   initializing argument 1 of ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)’
    ../src/country.cc: In static member function ‘static v8::Handle<v8::Value> geoip::Country::lookup(const v8::Arguments&)’:
    ../src/country.cc:112: error: invalid conversion from ‘int (*)(eio_req*)’ to ‘void (*)(eio_req*)’
    ../src/country.cc:112: error:   initializing argument 1 of ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)’
    ../src/country6.cc: In static member function ‘static v8::Handle<v8::Value> geoip::Country6::lookup(const v8::Arguments&)’:
    ../src/country6.cc:122: error: invalid conversion from ‘int (*)(eio_req*)’ to ‘void (*)(eio_req*)’
    ../src/country6.cc:122: error:   initializing argument 1 of ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)’
    [ 5/11] cxx: src/region.cc -> build/Release/src/region_1.o
    ../src/region.cc: In static member function ‘static v8::Handle<v8::Value> geoip::Region::lookup(const v8::Arguments&)’:
    ../src/region.cc:114: error: invalid conversion from ‘int (*)(eio_req*)’ to ‘void (*)(eio_req*)’
    ../src/region.cc:114: error:   initializing argument 1 of ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)’
    Waf: Leaving directory `/var/www/hummingbird/node_modules/geoip/build'
    Build failed:
     -> task failed (err #1): 
        {task: cxx netspeed.cc -> netspeed_1.o}
     -> task failed (err #1): 
        {task: cxx country.cc -> country_1.o}
     -> task failed (err #1): 
        {task: cxx country6.cc -> country6_1.o}
     -> task failed (err #1): 
        {task: cxx region.cc -> region_1.o}
    npm ERR! error installing geoip@0.4.4 Error: geoip@0.4.4 preinstall: `node-waf clean || true; node-waf configure build`
    npm ERR! error installing geoip@0.4.4 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
    npm ERR! error installing geoip@0.4.4     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
    npm ERR! error installing geoip@0.4.4     at ChildProcess.emit (events.js:70:17)
    npm ERR! error installing geoip@0.4.4     at maybeExit (child_process.js:336:16)
    npm ERR! error installing geoip@0.4.4     at Process.onexit (child_process.js:371:5)
    npm ERR! geoip@0.4.4 preinstall: `node-waf clean || true; node-waf configure build`
    npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
kuno commented 13 years ago

This problem was caused by the change of api from node 0.4.x to 0.6. I just fixed it in the master branch, you can give it a try. But this only works with node >= 0.5.0. So it won't be released until node 0.6 is out.

jedigras commented 12 years ago

Still have the same installation issue. Are you use this is fixed?

CentOS release 5.7 (Final)

$ npm -v 1.0.106

$ node -v v0.6.5

$ yum info GeoIP Loaded plugins: fastestmirror, priorities Installed Packages Name : GeoIP Arch : i386 Version : 1.4.8 Release : 1.el5 ...

-------------- Error -------------

Build failed: -> task failed (err #1): {task: cxx init.cc -> init_1.o} -> task failed (err #1): {task: cxx country6.cc -> country6_1.o} -> task failed (err #1): {task: cxx country.cc -> country_1.o} -> task failed (err #1): {task: cxx netspeed.cc -> netspeed_1.o} npm ERR! geoip@0.4.5 preinstall: node-waf clean || true; node-waf configure build npm ERR! sh "-c" "node-waf clean || true; node-waf configure build" failed with 1 npm ERR! npm ERR! Failed at the geoip@0.4.5 preinstall script.

kuno commented 12 years ago

I guess you don't have headers files installed on your system. Try this:

yum install GeoIP-devel
jedigras commented 12 years ago

Success! Thanks for the quick reply.

On Fri, Dec 9, 2011 at 8:42 PM, kuno < reply@reply.github.com

wrote:

I guess you don't have headers files installed on your system. Try this:

yum install GeoIP-devel


Reply to this email directly or view it on GitHub: https://github.com/kuno/GeoIP/issues/22#issuecomment-3088576

funston commented 12 years ago

I'm getting the same error on Debian. Did a apt-get install libgeoip-devel...Node 0.6.9