Comments (9)
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.
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.jswhere 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.
can you try with the test script
server\node_modules\geoip-lite\test\geo-lookup.js
from node-geoip.
closing due to no response from reporter
from node-geoip.
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.
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.
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.
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.
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)
- Make updatedb fast
- Library unusable due to "colors" module debacle HOT 1
- URLs in updatedb.js no longer work
- ERR_BUFFER_OUT_OF_BOUNDS after automatic update HOT 2
- Re: Database updates HOT 16
- Custom directory in updatedb doesn't work. HOT 6
- Sometimes geoip return null value HOT 3
- returns wrong country for 72.18.74.123 HOT 1
- Update database HOT 1
- 401 Unauthorized when trying to upgrade HOT 8
- Upgrade is extremely slow. HOT 4
- Get the postal / zip code ? HOT 1
- The included data is out of date HOT 2
- remove fs dependency
- IP from US but the returned result is from Africa HOT 3
- Incorrect geolocation for non-geolocated IPs HOT 8
- IPv6 not working HOT 4
- Error in getting the Info HOT 2
- Seeking insight into the development process and buffer lookup approach used. HOT 2
- updatedb.js: ERROR: HTTP Request Failed [302 Found]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-geoip.