Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error: Unable to load shared library #38

Closed
gabrielpreston opened this Issue · 9 comments

3 participants

@gabrielpreston

I'm running into the following problem when I try to use the module.

OS: Red Hat Enterprise Linux Server release 5.3 (Tikanga)
Kernel: Linux myserver 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
NPM: 1.1.16
Node: v0.6.15
GeoIP: 1.4.8

Code:

var geoip = require('geoip');

var edition = geoip.check('/home/project/GeoLiteCity.dat');

console.log(edition);

Error:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Unable to load shared library /home/project/node_modules/geoip/build/Release/geoip.node
    at Object..node (module.js:472:11)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object.<anonymous> (/home/project/node_modules/geoip/index.js:4:15)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12
@kuno
Owner

How do you install geoip, from npm registry or locally?
And can you check it out manually that If there is actually geoip.node binary file inside your /home/project/node_modules/geoip/build/Release folder?

@gabrielpreston

I installed the geoip module using 'npm install geoip'. And the geoip.node file does exist:

./node_modules/geoip/build/Release/geoip.node: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
@kuno
Owner

Maybe you should try install in a global wild:

sudo npm install geoip -g
@gabrielpreston

Unfortunately I still run into the same problem:

Error: Unable to load shared library /usr/local/lib/node_modules/geoip/build/Release/geoip.node
/usr/local/lib/node_modules/geoip/build/Release/geoip.node: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
@kuno
Owner

try set NODE_PATH environment variable:

export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules/
@gabrielpreston

Yeah, that is what I did in order to make use of the global geoip module since I uninstalled the local geoip module.

@gorillamania

Same exact problem on CentOS 6.2, geoip 0.4.5, node 0.6.15, GeoIP 1.4.7

@gorillamania

RESOLVED:

On Centos and [apparently] RHEL, when compiling the MaxMind db from source as recommended on the README, it places the libraries in the wrong place. I resolved this error by installing GeoIP via yum:

sudo yum install GeoIP

@kuno
Owner

@gorillamania:
glad to hear that.
I think install geoip from your package manager is the recommended way to do so.
Compiling from the source code will only be the backup choice.

@kuno kuno closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.