Coder Social home page Coder Social logo

Comments (9)

bluesmoon avatar bluesmoon commented on July 19, 2024

what does the code of geoipTest.js look like?

what's the directory structure where you installed geoip-lite?

where did you copy the .dat files to?

what IP addresses are you trying with?

from node-geoip.

parindam avatar parindam commented on July 19, 2024

answers inline..

On Sat, Mar 17, 2012 at 9:34 PM, Philip Tellis <
[email protected]

wrote:

what does the code of geoipTest.js look like?

var geoip = require('geoip-lite');
var ip = "122.167.126.108";
var geo = geoip.lookup(ip);

console.log(geo);

what's the directory structure where you installed geoip-lite?

c:\server\node_modules\geoip-lite
c:\server\geoipTest.js

where did you copy the .dat files to?

c:\server\node_modules\geoip-lite\data

what IP addresses are you trying with?

"122.167.126.108"


Reply to this email directly or view it on GitHub:
#4 (comment)

Thanks,
Arindam.

from node-geoip.

bluesmoon avatar bluesmoon commented on July 19, 2024

can you try with the test script
server\node_modules\geoip-lite\test\geo-lookup.js

from node-geoip.

bluesmoon avatar bluesmoon commented on July 19, 2024

closing due to no response from reporter

from node-geoip.

cryptocompress avatar cryptocompress commented on July 19, 2024

i have same problem:

vagrant@lucid32:/myapp$ node node_modules/geoip-lite/test/geo-lookup.js 93.133.238.214
null
Startup: 8ms, exec: 1ms
vagrant@lucid32:/myapp$ rm node_modules/geoip-lite/data/geoip-city.dat node_modules/geoip-lite/data/geoip-city-names.dat
vagrant@lucid32:/myapp$ node node_modules/geoip-lite/test/geo-lookup.js 93.133.238.214

======================== Warning ========================
 City data not found, falling back to country data.
 Get the latest city data files from

 https://github.com/bluesmoon/node-geoip/tree/master/data

 You need geoip-city-names.dat and geoip-city.dat
 Put them into the data/ directory for this package
======================== Warning ========================


{ range: [ 1568636928, 1569193983 ],
  country: 'DE',
  region: '',
  city: '',
  ll: [ 0, 0 ] }
Startup: 10ms, exec: 3ms
vagrant@lucid32:/myapp$

any idea?

from node-geoip.

bluesmoon avatar bluesmoon commented on July 19, 2024

Are you using the latest city data files? Get them from git. This is what I see:

$ node geo-lookup.js 93.133.238.214
{ range: [ 1569057280, 1569060607 ],
  country: 'DE',
  region: '02',
  city: 'Munich',
  ll: [ 48.15, 11.5833 ] }
Startup: 772ms, exec: 8ms

from node-geoip.

cryptocompress avatar cryptocompress commented on July 19, 2024
vagrant@lucid32:~$ cd /myapp/
vagrant@lucid32:/myapp$ node node_modules/geoip-lite/test/geo-lookup.js 93.133.238.214

======================== Warning ========================
 City data not found, falling back to country data.
 Get the latest city data files from

 https://github.com/bluesmoon/node-geoip/tree/master/data

 You need geoip-city-names.dat and geoip-city.dat
 Put them into the data/ directory for this package
======================== Warning ========================


{ range: [ 1568636928, 1569193983 ],
  country: 'DE',
  region: '',
  city: '',
  ll: [ 0, 0 ] }
Startup: 10ms, exec: 3ms
vagrant@lucid32:/myapp$ cd node_modules/geoip-lite/data/ && wget https://github.com/bluesmoon/node-geoip/blob/master/data/geoip-city-names.dat && wget https://github.com/bluesmoon/node-geoip/blob/master/data/geoip-city.dat
--2012-07-22 19:45:53--  https://github.com/bluesmoon/node-geoip/blob/master/data/geoip-city-names.dat
Resolving github.com... 207.97.227.239
Connecting to github.com|207.97.227.239|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31168 (30K) [text/html]
Saving to: `geoip-city-names.dat'

100%[=====================================================================================================================================>] 31,168      --.-K/s   in 0.1s

2012-07-22 19:45:59 (246 KB/s) - `geoip-city-names.dat' saved [31168/31168]

--2012-07-22 19:45:59--  https://github.com/bluesmoon/node-geoip/blob/master/data/geoip-city.dat
Resolving github.com... 207.97.227.239
Connecting to github.com|207.97.227.239|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31073 (30K) [text/html]
Saving to: `geoip-city.dat'

100%[=====================================================================================================================================>] 31,073      --.-K/s   in 0.1s

2012-07-22 19:46:00 (253 KB/s) - `geoip-city.dat' saved [31073/31073]

vagrant@lucid32:/myapp/node_modules/geoip-lite/data$ node ../test/geo-lookup.js 93.133.238.214
null
Startup: 7ms, exec: 2ms
vagrant@lucid32:/myapp/node_modules/geoip-lite/data$

from node-geoip.

bluesmoon avatar bluesmoon commented on July 19, 2024

I really can't say why this happens for you, but the fact that Startup time is 7ms suggests that it isn't really loading the data files. Is there any chance you can trace through the code and find out what's happening?

from node-geoip.

thiagobfiorenza avatar thiagobfiorenza commented on July 19, 2024

Hi,
Is the geoip-city.dat file you use from this place?
https://dev.maxmind.com/geoip/legacy/geolite/#Downloads

from node-geoip.

Related Issues (20)

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.