Coder Social home page Coder Social logo

geoip-lite / node-geoip Goto Github PK

View Code? Open in Web Editor NEW
2.3K 2.3K 352.0 459.06 MB

Native NodeJS implementation of MaxMind's GeoIP API -- works in node 0.6.3 and above, ask me about other versions

Home Page: https://npmjs.org/package/geoip-lite

License: Other

JavaScript 100.00%

node-geoip's People

Contributors

64json avatar adityapatadia avatar ar2rsawseen avatar bevacqua avatar bluesmoon avatar bwp91 avatar chill117 avatar corollari avatar ctalkington avatar dylanpiercey avatar echiu64 avatar ecwyne avatar estliberitas avatar gui avatar hellohungryimdad avatar inversion avatar jamiestivala avatar jimflip avatar jonathanong avatar jordanj77 avatar justinpage avatar lneveu avatar lynxysscz avatar orktes avatar ostseb avatar parisholley avatar patelatharva avatar scalder27 avatar surzhynskyi avatar tshemsedinov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-geoip's Issues

breaks heroku

the scripts are breaking the build when I upload to heroku

Buffer Overflow

This week the updatedb script started failing, this is the error:

(...)
   Still working (1749315) ...                                                                                             
   Still working (1850667) ...                                                                                             
   buffer.js:784                                                                                                           
       throw TypeError('value is out of bounds');                                                                          
             ^                                                                                                             
   TypeError: value is out of bounds                                                                                       
       at TypeError (<anonymous>)                                                                                          
       at checkInt (buffer.js:784:11)                                                                                      
       at Buffer.writeInt32BE (buffer.js:924:5)                                                                            
       at processLine (/tmp/build_8589d1d9-f0b1-4547-9fa7-48a26db710a7/node_modules/geoip-lite/scripts/updatedb.js:337:5)  
       at /tmp/build_8589d1d9-f0b1-4547-9fa7-48a26db710a7/node_modules/geoip-lite/node_modules/lazy/lazy.js:99:35          
       at Lazy.<anonymous> (/tmp/build_8589d1d9-f0b1-4547-9fa7-48a26db710a7/node_modules/geoip-lite/node_modules/lazy/lazy.js:74:37)     
(...)

Any tips towards solving this?

Feature Request: Reverse Geocode

Thanks for the great module.

I have one more requirement though. I need to find out the city details from the latitude and longitude values. Since the maxmind database already contains tables which contain these values, should that be doable?
I found some node modules which are calling google apis for this, however, I am trying to see if I can achieve this without calling a web service and can do it offline.

Feature request: DMA codes

We're writing a Node.js application that requires us to selectively block IP addresses by DMA code. I know that we could achieve this by mapping IP address to city using GeoIP-Lite and then mapping city to DMA code using tables from Google AdWords, but synching to those tables regularly could be a pain. Would it difficult to have GeoIP-Lite include DMA code from MaxMind in the location data lookup result? Thanks!

Feature Request: Zip/Postal Code

I just noticed zip code isn't parsed out from the City dat. It should be there for requests. I don't know if it's under Postal Code or Zip Code. But should be there for located cities.

Reduce RAM footprint by just using country?

First of all - great library, makes a complicated thing so simple.

For our project, all we're looking to do is group customers by country. Is it possible to use this module without having to load in all the other more specific region and metro code data to reduce the memory footprint?

Clearly it'll work with a fork, but curious to see if there's another way.

small memory leak

I tried looping over all IP addresses starting from 0.0.0.0 and doing a lookup for each one and I think I am experiencing a small memory leak.

After about 1 billion lookup, it starts getting really slow on my machine, probably because the memory of the process has increased to 2GB and the GC is trying to free some space.

$ node -v
v0.10.21

Any way I can help finding the leak? A tool I could use to generate a report maybe?

The script :

var geoip = require('geoip-lite');
var a, b, c, d, ip;
for(a=0; a<=255; a++) {
    for(b=0; b<=255; b++) {
        for(c=0; c<=255; c++) {
            for(d=0; d<=255; d++) {
                ip = a+"."+b+"."+c+"."+d;
                geoip.lookup(ip);
            }
        }
        console.log(ip);
    }
}

Encoding problems

var geoip = require('geoip-lite');
var ip = "109.190.22.231";
var geo = geoip.lookup(ip);
console.log(geo);

gives :

{ range: [ 1841174016, 1841174527 ],
country: 'FR',
region: 'A8',
city: 'Montlh�ry',
ll: [ 48.64, 2.2747 ] }

note the city name, it should be 'Montlhéry'

Coordinates?

Are there any plans to start returning a set of get coordinates along with the City/State info?

ISO Country code to full country name

Currently the only country output available via node-geoip is the short ISO code. Is it possible to add the full country name to the output or via some option var?

Can't install geoip-lite

Hello.

I get following error message when I try to install it on RHEL6

$ npm install geoip-lite

[email protected] updatedb /home/hayashis/dev/psnow/node_modules/geoip-lite
node scripts/updatedb.js

Retrieving GeoIPCountryCSV.zip ... DONE
Extracting GeoIPCountryCSV.zip ...
events.js:72
throw er; // Unhandled 'error' event
^
Error: ENOSPC, write

npm ERR! [email protected] updatedb: node scripts/updatedb.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] updatedb script.
npm ERR! This is most likely a problem with the geoip-lite package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/updatedb.js
npm ERR! You can get their info via:
npm ERR! npm owner ls geoip-lite
npm ERR! There is likely additional logging output above.

wrong data when using watch

I've been noticing that at random, geoip look ups were being skewed (ie: my ip was pointing to a completely different place). I believe the issue, is that the npm update-db script actually takes about ~10 minutes for it to complete (GeoLiteCity-latest takes a long time), and when switching between files, not really sure what is going on. I was able to reproduce with this script:

var geoip = require('geoip-lite');

setInterval(function(){
    console.log(geoip.lookup('75.82.117.180'));
}, 2000);

geoip.startWatchingDataUpdate();

I then run the update in the background, and things work great. But as soon as the update completes (i'd say about a minute later), the lookup output changes.

I'm going to try upping the timeout on the watcher to 15 minutes instead of a minute and see if that helps.

Installation issue

It depends on the machine, but Ubuntu 14.04 installed via Meteor packages this error occurs:

TypeError: Arguments to path.resolve must be strings
    at Object.exports.resolve (path.js:313:15)
    at mkdirP (/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:15:14)
    at Conf.<anonymous> (/usr/lib/node_modules/npm/node_modules/npmconf/lib/load-prefix.js:29:7)
    at /usr/lib/node_modules/npm/node_modules/npmconf/lib/find-prefix.js:11:7
    at process._tickCallback (node.js:419:13)


/usr/lib/node_modules/npm/lib/npm.js:33
    throw new Error('npm.load() required')
          ^
Error: npm.load() required
    at Object.npm.config.get (/usr/lib/node_modules/npm/lib/npm.js:33:11)
    at exit (/usr/lib/node_modules/npm/lib/utils/error-handler.js:49:27)
    at process.errorHandler (/usr/lib/node_modules/npm/lib/utils/error-handler.js:316:3)
    at process.emit (events.js:95:17)
    at process._fatalException (node.js:272:26)
npm ERR! [email protected] postinstall: `npm run-script updatedb`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the geoip-lite package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run-script updatedb
npm ERR! You can get their info via:
npm ERR!     npm owner ls geoip-lite
npm ERR! There is likely additional logging output above.

Running updatedb silently fails while extracting GeoLitCity-latest.zip

A program I wrote to process my site's HTTP logfile uses node-geoip. This is on a Windows machine. The script runs as a command line utility and then ends, it doesn't start a server.

Data returned for IP address (104.193.9.149) is null. When running npm run-script updatedb from the node_modules\geoip-lite folder, this is the output:

> [email protected] updatedb D:\source\github\loghowder\node_modules\geoip-lite
> node scripts/updatedb.js

Retrieving GeoIPCountryCSV.zip ... DONE
Extracting GeoIPCountryCSV.zip ... DONE
Processing Data (may take a moment) ... DONE

Retrieving GeoIPv6.csv ... DONE
Processing Data (may take a moment) ... DONE

Retrieving GeoLiteCity-latest.zip ... DONE
Extracting GeoLiteCity-latest.zip ...

After this data for the IP address is still not found, even though I think I see it is covered by the MaxMind database.
To prevent a rate-limiting problem to download the files I've waited more then a day to run the update script.

Does someone have a suggestion to solve this? Is there a way to see why the script stops, logging perhaps?

thanks,
rob schlüter

is it blocking?

Hi,
for every request, i got a code like this:

var geo = geoip.lookup(ip);

geo is from : var geoip = require('geoip-lite')

is this a blocking code? my cpu usage goes up to 90-100% sometimes, so I'm looking for the spots that cause the issue, will above code block the request? thanks,

angelo

no working

Hey,

Every time i try to require the library, i get a screen full of weird charaters (i guess the binary data converted to string) and the lookup never run

Is this library up to date anymore?

super slow install

can we just cache in the module and refresh the data sometimes? I'd definitely prefer to not have to hack around this for deployments but it's way too slow

Adding citydata returns null for location

When Install geoip-lite, it works fine without city data.

node /node_modules/geoip-lite/test/geo-lookup.js 24.120.170.58

Output:

{ range: [ 410189824, 410648575 ],
country: 'US',
region: '',
city: '',
ll: [ 0, 0 ] }
Startup: 10ms, exec: 4ms

However, when I do:

wget https://github.com/bluesmoon/node-geoip/blob/master/data/geoip-city.dat

and

wget https://github.com/bluesmoon/node-geoip/blob/master/data/geoip-city-names.dat

into /node_modules/geoip-lite/data

Tested with city-data, returns null:

node /node_modules/geoip-lite/test/geo-lookup.js 24.120.170.58

Output:

null
Startup: 8ms, exec: 2ms

npm install error

npm install geoip-lite
npm http GET https://registry.npmjs.org/geoip-lite
npm http 304 https://registry.npmjs.org/geoip-lite
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/colors/0.6.0-1
npm http GET https://registry.npmjs.org/iconv-lite
npm http GET https://registry.npmjs.org/lazy
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/unzip
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/colors/0.6.0-1
npm http 304 https://registry.npmjs.org/unzip
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/lazy
npm http 304 https://registry.npmjs.org/iconv-lite
npm http 304 https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/pullstream/0.0.4
npm http GET https://registry.npmjs.org/binary
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/binary
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/pullstream/0.0.4
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/over
npm http GET https://registry.npmjs.org/stream-buffers
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/stream-buffers
npm http 304 https://registry.npmjs.org/over
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/chainsaw
npm http GET https://registry.npmjs.org/buffers
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/chainsaw
npm http 304 https://registry.npmjs.org/buffers
npm http GET https://registry.npmjs.org/traverse
npm http 304 https://registry.npmjs.org/traverse

[email protected] postinstall /node_modules/geoip-lite
npm run-script updatedb

[email protected] updatedb /node_modules/geoip-lite
node scripts/updatedb.js

Retrieving GeoIPCountryCSV.zip ... DONE
Extracting GeoIPCountryCSV.zip ... DONE
Processing Data (may take a moment) ... DONE

Retrieving GeoIPv6.csv ... DONE
Processing Data (may take a moment) ... DONE

Retrieving GeoLiteCity-latest.zip ... DONE
Extracting GeoLiteCity-latest.zip ...Killed
root@socialwebshop1:/# Killed

npm ERR! [email protected] updatedb: node scripts/updatedb.js
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the [email protected] updatedb script.
npm ERR! This is most likely a problem with the geoip-lite package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/updatedb.js
npm ERR! You can get their info via:
npm ERR! npm owner ls geoip-lite
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.8.0-38-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "run-script" "updatedb"
npm ERR! cwd /node_modules/geoip-lite
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /node_modules/geoip-lite/npm-debug.log
npm ERR! not ok code 0

Outside ipv4 range

The example code under synopsis, returns null for being outside IPv4 range. This is on node v0.6.14.

Also, it would be helpful to return error messages or responses, instead of just null.

Another geoip-lite installation failure

Hi Everyone,

Yes, another issue but my case is a little different than the other issues.

  • Running vagrant + ubuntu 12.04 + virtualbox
  • the VM has 3gb ram allocated

Most of the time I get this error when provision new machines

> [email protected] postinstall /vagrant/vungle/node_modules/geoip-lite
> npm run-script updatedb


> [email protected] updatedb /vagrant/vungle/node_modules/geoip-lite
> node scripts/updatedb.js

Retrieving GeoIPCountryCSV.zip ... DONE
Extracting GeoIPCountryCSV.zip ... DONE
Processing Data (may take a moment) ...
Still working (47700) ... DONE

Retrieving GeoIPv6.csv ... DONE
Processing Data (may take a moment) ... DONE

Retrieving GeoLiteCity-latest.zip ... DONE
Extracting GeoLiteCity-latest.zip ... DONE
Processing Data (may take a moment) ...
events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: ENOENT, open '/vagrant/vungle/node_modules/geoip-lite/tmp/GeoLiteCity/GeoLiteCity-Blocks.csv'

npm ERR! [email protected] updatedb: `node scripts/updatedb.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] updatedb script.
npm ERR! This is most likely a problem with the geoip-lite package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/updatedb.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls geoip-lite
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.8.0-42-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "run-script" "updatedb"
npm ERR! cwd /vagrant/vungle/node_modules/geoip-lite
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /vagrant/vungle/node_modules/geoip-lite/npm-debug.log
npm ERR! not ok code 0
npm ERR! [email protected] postinstall: `npm run-script updatedb`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the geoip-lite package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run-script updatedb
npm ERR! You can get their info via:
npm ERR!     npm owner ls geoip-lite
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.0-42-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /vagrant/vungle
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /vagrant/vungle/npm-debug.log
npm ERR! not ok code 0

Sometimes I get this:

Retrieving GeoIPCountryCSV.zip ...ERROR: HTTP Request Failed [403 Forbidden]

Do you think you can help me with this? thanks a lot!

Tony

GeoIP UpdateDB script fails with 'value is out of bounds' error

I'm suddenly receiving an OOB error:

buffer.js:705
    throw TypeError('value is out of bounds');
          ^
TypeError: value is out of bounds
    at TypeError (<anonymous>)
    at checkInt (buffer.js:705:11)
    at Buffer.writeInt32BE (buffer.js:792:5)
    at processLine (/Users/blimmer/code/Ibotta-Staging/tmp/webapp/dist/node_modules/geoip-lite/scripts/updatedb.js:367:5)
    at /Users/blimmer/code/Ibotta-Staging/tmp/webapp/dist/node_modules/geoip-lite/node_modules/lazy/lazy.js:99:35
    at Lazy.<anonymous> (/Users/blimmer/code/Ibotta-Staging/tmp/webapp/dist/node_modules/geoip-lite/node_modules/lazy/lazy.js:74:37)
    at Lazy.emit (events.js:98:17)
    at Lazy.<anonymous> (/Users/blimmer/code/Ibotta-Staging/tmp/webapp/dist/node_modules/geoip-lite/node_modules/lazy/lazy.js:74:22)
    at Lazy.emit (events.js:98:17)
    at Lazy.<anonymous> (/Users/blimmer/code/Ibotta-Staging/tmp/webapp/dist/node_modules/geoip-lite/node_modules/lazy/lazy.js:74:22)

npm ERR! [email protected] updatedb: `node scripts/updatedb.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] updatedb script.
npm ERR! This is most likely a problem with the geoip-lite package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/updatedb.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls geoip-lite
npm ERR! There is likely additional logging output above.

From previously closed issues, it seems like this is caused by a CSV parsing error.

Doesn't play nicely with node-webkit

Howdy.

Not sure what's going on here. When I run a script with the following via node-webkit, I get null. When I run with node (via terminal), I get a result.

var geoip = require('geoip-lite');  
var res = geoip.lookup("8.8.8.8");  
console.log(res);

Encoding problems

var geoip = require('geoip-lite');
var ip = "31.17.105.227";
var geo = geoip.lookup(ip);
console.log(geo);

gives:

{ range: [ 521234688, 521234943 ],
  country: 'DE',
  region: '10',
  city: 'Todenb�ttel',
  ll: [ 54.1333, 9.55 ] }

note the city name, it should be 'Todenbüttel'
Package version: 1.1.0, after running a successful update (npm run-script updatedb).
Also another (small) request: could you update the data files on Git, too? Or are you not allowed to do that?

thanks for making this

hey, i'm not sure how else to tell you this other than by filing an issue. just wanted to say thanks for making this--I've never tried compiling the C library that the other libs rely on, but dealing with such things has always been fraught with peril for me. having a fully JS version is enormously useful!

Errors after updating the db

I tried to update the DB from maxmind.
After that I tried to make a lookup for 194.183.97.113
The returning result was:

{ range: [ 3266797872, 3266798591 ],
country: '(u',
region: '�(',
city: '',
ll: [ -176154.1992, 1680.4097 ] }

4 month ago this ip was related to GB and now should be ES.

What I'm doing wrong?
or
What is the right way to update the database?

npm release?

Would it be possible to get an updated npm release any time soon?

The new update system, for example, is lovely, but it's not present in the latest tarball on npm

City data not working

I was having a problem with getting the city data to work, and I noticed there were a few reported issues on here about it. So, I've spent the morning looking into it. It appears the city dat files you download from:
https://github.com/bluesmoon/node-geoip/tree/master/data
Are not correct. They are far too small for one.
geoip-city.dat 21.9kB
geoip-city-names.dat 22kB

So, I went to MaxMind's website (http://dev.maxmind.com/geoip/geolite) and downloaded a new CSV for Cities. When I extracted the ZIP, to my surprise I got 2 files. So, I tried both.

GeoLiteCity-Location.csv is 21.1MB (DIDN'T WORK)
GeoLiteCity-Blocks.csv is 75.5MB (WORKED)

You need to run the command:
node city-converter.js GeoLiteCity-Blocks.csv geoip-city.dat

This produced the files:
geoip-city.dat
geoip-city-names.dat

Put these 2 files in the "Data" folder and it should be working now.
{ range: [ 3479297920, 3479304169 ],
country: 'US',
region: 'TX',
city: 'San Antonio',
ll: [ 29.4889, -98.3987 ] }

Hurray!

HTTP Request Failed [403 Forbidden] while installing

I get this error while installing, even though perhaps it was successful. I'm not sure what to make of it

> [email protected] updatedb /Users/tarang/Desktop/testip/node_modules/geoip-lite
> node scripts/updatedb.js

 DONEeving GeoIPCountryCSV.zip ...
 DONEcting GeoIPCountryCSV.zip ...
 DONEssing Data (may take a moment) ...

 DONEeving GeoIPv6.csv ...
 DONEssing Data (may take a moment) ...

ERROR: HTTP Request Failed [403 Forbidden]
[email protected] node_modules/geoip-lite
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected])

Post install Segmentation Fault on node 0.10.31

nvm use v0.10.31
Node: 0.10.31
Npm: 1.4.23

> [email protected] postinstall /Users/thomas/work/cine-io/cine/node_modules/geoip-lite
> npm run-script updatedb


> [email protected] updatedb /Users/thomas/work/cine-io/cine/node_modules/geoip-lite
> node scripts/updatedb.js

Retrieving GeoIPCountryCSV.zip ... DONE
Extracting GeoIPCountryCSV.zip ... DONE
Processing Data (may take a moment) ...Segmentation fault: 11

nvm use v0.10.30
Node: 0.10.30
Npm: 1.4.21

> [email protected] postinstall /Users/thomas/work/cine-io/cine/node_modules/geoip-lite
> npm run-script updatedb


> [email protected] updatedb /Users/thomas/work/cine-io/cine/node_modules/geoip-lite
> node scripts/updatedb.js

Retrieving GeoIPCountryCSV.zip ... DONE
Extracting GeoIPCountryCSV.zip ... DONE
Processing Data (may take a moment) ... DONE

Retrieving GeoIPv6.csv ... DONE
Processing Data (may take a moment) ... DONE

Retrieving GeoLiteCity-latest.zip ... DONE
Extracting GeoLiteCity-latest.zip ... DONE
Processing Data (may take a moment) ...
Still working (152503) ...
Still working (319102) ...
Still working (499383) ...
Still working (726948) ...
Still working (957686) ...
Still working (1187663) ...
Still working (1409492) ...
Still working (1634370) ...
Still working (1858137) ... DONE

Retrieving GeoLiteCityv6.csv ... DONE
Processing Data (may take a moment) ... DONE

npm run-script updatedb throws TypeError('value is out of bounds')

node scripts/updatedb.js

Retrieving GeoIPCountryCSV.zip ... DONE
Extracting GeoIPCountryCSV.zip ... DONE
Processing Data (may take a moment) ... DONE

Retrieving GeoIPv6.csv ... DONE
Processing Data (may take a moment) ... DONE

Retrieving GeoLiteCity-latest.zip ... DONE
Extracting GeoLiteCity-latest.zip ... DONE
Processing Data (may take a moment) ...
Still working (197380) ...
Still working (368808) ...
Still working (560022) ...
Still working (761515) ...
Still working (963013) ...
Still working (1168723) ...
Still working (1368510) ...
Still working (1543327) ...
Still working (1721871) ...
buffer.js:784
throw TypeError('value is out of bounds');
^
TypeError: value is out of bounds
at TypeError ()
at checkInt (buffer.js:784:11)
at Buffer.writeInt32BE (buffer.js:924:5)
at processLine (/Users/jaan/Sites/geoiptest/node_modules/geoip-lite/scripts/updatedb.js:337:5)
at /Users/jaan/Sites/geoiptest/node_modules/geoip-lite/node_modules/lazy/lazy.js:99:35
at Lazy. (/Users/jaan/Sites/geoiptest/node_modules/geoip-lite/node_modules/lazy/lazy.js:74:37)
at Lazy.EventEmitter.emit (events.js:98:17)
at Lazy. (/Users/jaan/Sites/geoiptest/node_modules/geoip-lite/node_modules/lazy/lazy.js:74:22)
at Lazy.EventEmitter.emit (events.js:98:17)
at Lazy. (/Users/jaan/Sites/geoiptest/node_modules/geoip-lite/node_modules/lazy/lazy.js:74:22)

Feature Request: Continent Codes

Although only mildly helpful for humans, having continent codes are very useful for bayesian classifiers. For most cases, connections from continents other than their own are suspect.

npm run-script updatedb not work

I try run "npm run-script updatedb" on cmd window but not show anything.
I have figure it out.
@bluesmoon
But I have question why need GeoIPContryCSV if in data directory already have geoip-country.dat and when I download GeoLiteCity.dat.gz what next to do ? with GeoLite files

Ofer Velich

Failed to install "npm install geoip-lite" on ubuntu 13.10,
Error stack:
.....
....
Extracting GeoLiteCity-latest.zip ...Killed
npm ERR! [email protected] updatedb: node scripts/updatedb.js
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the [email protected] updatedb script.
npm ERR! This is most likely a problem with the geoip-lite package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/updatedb.js
npm ERR! You can get their info via:
npm ERR! npm owner ls geoip-lite
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.11.0-15-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "run-script" "updatedb"
npm ERR! cwd /home/ubuntu/node_modules/geoip-lite
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ubuntu/node_modules/geoip-lite/npm-debug.log
npm ERR! not ok code 0

download data separately

The data files are quite large and it would be nice to not have them download with npm (or maybe even in the git repo). A user would generally only download them once and try to reuse those versions.

Maybe consider having a flag for npm (I think it can do this) to download the files but otherwise let the user specify the data files.

One use case is continuous deployment setups where a fresh clone and thus fresh npm install is done for each instance.

npm install fails on Digital Ocean Ubuntu

[email protected] postinstall /home/cloud/node_modules/geoip-lite
npm run-script updatedb

[email protected] updatedb /home/cloud/node_modules/geoip-lite
node scripts/updatedb.js

Retrieving GeoIPCountryCSV.zip ... DONE
Extracting GeoIPCountryCSV.zip ... DONE
Processing Data (may take a moment) ...
Still working (85333) ... DONE

Retrieving GeoIPv6.csv ... DONE
Processing Data (may take a moment) ... DONE

Retrieving GeoLiteCity-latest.zip ... DONE
Extracting GeoLiteCity-latest.zip ...Killed

npm ERR! [email protected] updatedb: node scripts/updatedb.js
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the [email protected] updatedb script.
npm ERR! This is most likely a problem with the geoip-lite package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/updatedb.js
npm ERR! You can get their info via:
npm ERR! npm owner ls geoip-lite
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "run-script" "updatedb"
npm ERR! cwd /home/cloud/node_modules/geoip-lite
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/cloud/node_modules/geoip-lite/npm-debug.log
npm ERR! not ok code 0
npm ERR! [email protected] postinstall: npm run-script updatedb
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the geoip-lite package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run-script updatedb
npm ERR! You can get their info via:
npm ERR! npm owner ls geoip-lite
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /home/cloud
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/cloud/npm-debug.log
npm ERR! not ok code 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.