kuno / GeoIP

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

GeoIP not installable under node v0.10.4 #56

Closed ashbrener closed 11 years ago

ashbrener commented 11 years ago

Was installable under node v0.10.1, but cannot be installed under node v0.10.4. Installation works with -g flag but then the application cannot find the 'geoip' module

$ npm install geoip
npm http GET https://registry.npmjs.org/geoip
npm http 304 https://registry.npmjs.org/geoip

> geoip@0.4.9 install /opt/apollo/node_modules/geoip
> node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: Command failed: Traceback (most recent call last):
gyp ERR! stack   File "/usr/lib/python2.7/site.py", line 562, in <module>
gyp ERR! stack     main()
gyp ERR! stack   File "/usr/lib/python2.7/site.py", line 544, in main
gyp ERR! stack     known_paths = addusersitepackages(known_paths)
gyp ERR! stack   File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
gyp ERR! stack     user_site = getusersitepackages()
gyp ERR! stack   File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
gyp ERR! stack     user_base = getuserbase() # this will also set USER_BASE
gyp ERR! stack   File "/usr/lib/python2.7/site.py", line 236, in getuserbase
gyp ERR! stack     USER_BASE = get_config_var('userbase')
gyp ERR! stack   File "/usr/lib/python2.7/sysconfig.py", line 577, in get_config_var
gyp ERR! stack     return get_config_vars().get(name)
gyp ERR! stack   File "/usr/lib/python2.7/sysconfig.py", line 481, in get_config_vars
gyp ERR! stack     _CONFIG_VARS['userbase'] = _getuserbase()
gyp ERR! stack   File "/usr/lib/python2.7/sysconfig.py", line 206, in _getuserbase
gyp ERR! stack     return env_base if env_base else joinuser("~", ".local")
gyp ERR! stack   File "/usr/lib/python2.7/sysconfig.py", line 192, in joinuser
gyp ERR! stack     return os.path.expanduser(os.path.join(*args))
gyp ERR! stack   File "/usr/lib/python2.7/posixpath.py", line 260, in expanduser
gyp ERR! stack     userhome = pwd.getpwuid(os.getuid()).pw_dir
gyp ERR! stack KeyError: 'getpwuid(): uid not found: 24561'
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:632:15)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at maybeClose (child_process.js:730:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:5)
gyp ERR! System Linux 3.2.0-35-virtual
gyp ERR! command "node" "/usr/bin/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/apollo/node_modules/geoip
gyp ERR! node -v v0.10.4
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! geoip@0.4.9 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the geoip@0.4.9 install script.
npm ERR! This is most likely a problem with the geoip 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 geoip
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-35-virtual
npm ERR! command "/usr/bin/nodejs/bin/node" "/usr/bin/nodejs/bin/npm" "install" "geoip"
npm ERR! cwd /opt/apollo
npm ERR! node -v v0.10.4
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /opt/apollo/npm-debug.log
npm ERR! not ok code 0
kuno commented 11 years ago

No problem on my macbook air (OSX 10.8). What is your os?

And for me this seems not node's problem, but a problem related to node-gyp/python.

Can you clone the repo and in the repo directory do node-gyp rebuild?

sricc commented 11 years ago

+1

node v0.10.5 npm v1.2.18 ubuntu v12.10

Disregard, I got it working with the latest dev (0.4.10-dev), I was still on 0.4.8.

Thanks.

kuno commented 11 years ago

@sricc

That's great news for me :+1:

kuno commented 11 years ago

With the latest release, v0.4.10, this package is able to build by itself, not relying on external libgeoip anymore.

Closing.