Coder Social home page Coder Social logo

City data not working about node-geoip HOT 11 CLOSED

geoip-lite avatar geoip-lite commented on July 19, 2024
City data not working

from node-geoip.

Comments (11)

leostera avatar leostera commented on July 19, 2024

Has this been automated already?

from node-geoip.

bluesmoon avatar bluesmoon commented on July 19, 2024

@xantian15 yes, that is the prescribed way to do it

@leostera there is an updatedb script provided by @ctalkington

from node-geoip.

leostera avatar leostera commented on July 19, 2024

I'm trying to but running it at my projects root level I get this:

± npm --verbose run-script updatedb
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli '--verbose',
npm verb cli 'run-script',
npm verb cli 'updatedb' ]
npm info using [email protected]
npm info using [email protected]
npm verb read json path/to/my/projects/package.json
npm verb run-script [ 'preupdatedb', 'updatedb', 'postupdatedb' ]
npm info preupdatedb [email protected]
npm info updatedb [email protected]
npm info postupdatedb [email protected]
npm verb exit [ 0, true ]
npm info ok

On Apr 15, 2013, at 11:20 PM, Philip Tellis [email protected] wrote:

@xantian15 yes, that is the prescribed way to do it

@leostera there is an updatedb script provided by @ctalkington


Reply to this email directly or view it on GitHub.

from node-geoip.

bluesmoon avatar bluesmoon commented on July 19, 2024

have you tried the latest code? I just merged in some code. Also, the script ends with ok so it's probably ok.

from node-geoip.

leostera avatar leostera commented on July 19, 2024

I'm using https://github.com/bluesmoon/node-geoip/tarball/master as the source in my package.json.

After running it I still don't have the big .dat files in my data folder.

I tried this too:
± npm --verbose run-script geoip-lite updatedb
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli '--verbose',
npm verb cli 'run-script',
npm verb cli 'geoip-lite',
npm verb cli 'updatedb' ]
npm info using [email protected]
npm info using [email protected]
npm verb read json /Users/leostera/Repositories/farmshares/node_modules/geoip-lite/package.json
npm verb run-script [ 'preupdatedb', 'updatedb', 'postupdatedb' ]
npm info preupdatedb [email protected]
npm info updatedb [email protected]
npm verb unsafe-perm in lifecycle true

[email protected] updatedb /Users/leostera/Repositories/farmshares/node_modules/geoip-lite
node scripts/updatedb.js

module.js:340
throw err;
^
Error: Cannot find module '/Users/leostera/Repositories/farmshares/node_modules/geoip-lite/scripts/updatedb.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
npm info [email protected] Failed to exec updatedb script

Now I just tried using https://github.com/bluesmoon/node-geoip as the source in the package.json but I get this error:

npm ERR! not a package /var/folders/cs/gdky9k5x2jzgsvwytf36hqdh0000gn/T/npm-19264/1366079596273-0.1913695263210684/tmp.tgz
npm ERR! Error: ENOENT, open '/var/folders/cs/gdky9k5x2jzgsvwytf36hqdh0000gn/T/npm-19264/1366079596273-0.1913695263210684/package/package.json'

Thanks for your help :)
On Apr 15, 2013, at 11:31 PM, Philip Tellis [email protected] wrote:

o, the script ends with ok so it's probably ok.

from node-geoip.

leostera avatar leostera commented on July 19, 2024

Ok, I manually added the update.js file to the scripts folder (because it wasn't being installed with npm, regardless of the source).

Then cd node_modules/geoip-lite && npm i

And then go back two levels and run npm run-script geoip-lite updatedb

And then it works.
On Apr 15, 2013, at 11:34 PM, Leandro Ostera Villalva [email protected] wrote:

I'm using https://github.com/bluesmoon/node-geoip/tarball/master as the source in my package.json.

After running it I still don't have the big .dat files in my data folder.

I tried this too:
± npm --verbose run-script geoip-lite updatedb
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli '--verbose',
npm verb cli 'run-script',
npm verb cli 'geoip-lite',
npm verb cli 'updatedb' ]
npm info using [email protected]
npm info using [email protected]
npm verb read json /Users/leostera/Repositories/farmshares/node_modules/geoip-lite/package.json
npm verb run-script [ 'preupdatedb', 'updatedb', 'postupdatedb' ]
npm info preupdatedb [email protected]
npm info updatedb [email protected]
npm verb unsafe-perm in lifecycle true

[email protected] updatedb /Users/leostera/Repositories/farmshares/node_modules/geoip-lite
node scripts/updatedb.js

module.js:340
throw err;
^
Error: Cannot find module '/Users/leostera/Repositories/farmshares/node_modules/geoip-lite/scripts/updatedb.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
npm info [email protected] Failed to exec updatedb script

Now I just tried using https://github.com/bluesmoon/node-geoip as the source in the package.json but I get this error:

npm ERR! not a package /var/folders/cs/gdky9k5x2jzgsvwytf36hqdh0000gn/T/npm-19264/1366079596273-0.1913695263210684/tmp.tgz
npm ERR! Error: ENOENT, open '/var/folders/cs/gdky9k5x2jzgsvwytf36hqdh0000gn/T/npm-19264/1366079596273-0.1913695263210684/package/package.json'

Thanks for your help :)
On Apr 15, 2013, at 11:31 PM, Philip Tellis [email protected] wrote:

o, the script ends with ok so it's probably ok.

from node-geoip.

leostera avatar leostera commented on July 19, 2024

Also using

"geoip-lite": "*"

instead of using the github repo, works.
On Apr 15, 2013, at 11:34 PM, Leandro Ostera Villalva [email protected] wrote:

I'm using https://github.com/bluesmoon/node-geoip/tarball/master as the source in my package.json.

After running it I still don't have the big .dat files in my data folder.

I tried this too:
± npm --verbose run-script geoip-lite updatedb
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli '--verbose',
npm verb cli 'run-script',
npm verb cli 'geoip-lite',
npm verb cli 'updatedb' ]
npm info using [email protected]
npm info using [email protected]
npm verb read json /Users/leostera/Repositories/farmshares/node_modules/geoip-lite/package.json
npm verb run-script [ 'preupdatedb', 'updatedb', 'postupdatedb' ]
npm info preupdatedb [email protected]
npm info updatedb [email protected]
npm verb unsafe-perm in lifecycle true

[email protected] updatedb /Users/leostera/Repositories/farmshares/node_modules/geoip-lite
node scripts/updatedb.js

module.js:340
throw err;
^
Error: Cannot find module '/Users/leostera/Repositories/farmshares/node_modules/geoip-lite/scripts/updatedb.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
npm info [email protected] Failed to exec updatedb script

Now I just tried using https://github.com/bluesmoon/node-geoip as the source in the package.json but I get this error:

npm ERR! not a package /var/folders/cs/gdky9k5x2jzgsvwytf36hqdh0000gn/T/npm-19264/1366079596273-0.1913695263210684/tmp.tgz
npm ERR! Error: ENOENT, open '/var/folders/cs/gdky9k5x2jzgsvwytf36hqdh0000gn/T/npm-19264/1366079596273-0.1913695263210684/package/package.json'

Thanks for your help :)
On Apr 15, 2013, at 11:31 PM, Philip Tellis [email protected] wrote:

o, the script ends with ok so it's probably ok.

from node-geoip.

bluesmoon avatar bluesmoon commented on July 19, 2024

Can you try with the new package? There have been a few fixes.

from node-geoip.

Tug avatar Tug commented on July 19, 2024

Looks like it does not work with the last version of the city data

$ npm run-script geoip-lite updatedb

> [email protected] updatedb project_dir/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 (215445) ...
Still working (429268) ...
Still working (639016) ...
Still working (845422) ...
Still working (1064808) ...
Still working (1279583) ...
Still working (1491840) ...
Still working (1705210) ...
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 (project_dir/node_modules/geoip-lite/scripts/updatedb.js:337:5)
    at project_dir/node_modules/geoip-lite/node_modules/lazy/lazy.js:99:35
    at Lazy.<anonymous> (project_dir/node_modules/geoip-lite/node_modules/lazy/lazy.js:74:37)
    at Lazy.EventEmitter.emit (events.js:98:17)
    at Lazy.<anonymous> (project_dir/node_modules/geoip-lite/node_modules/lazy/lazy.js:74:22)
    at Lazy.EventEmitter.emit (events.js:98:17)
    at Lazy.<anonymous> (project_dir/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.
npm ERR! System Linux 3.11.0-14-generic
npm ERR! command "node" "/usr/local/bin/npm" "run-script" "geoip-lite" "updatedb"
npm ERR! cwd project_dir
npm ERR! node -v v0.10.21
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     project_dir/npm-debug.log
npm ERR! not ok code 0

from node-geoip.

Tug avatar Tug commented on July 19, 2024

Ok my bad, it works fine with the last version from github.
I ran this command on the packaged version of npm repository.

You may want to update the package though.

from node-geoip.

ar2rsawseen avatar ar2rsawseen commented on July 19, 2024

It seems this has been resolved

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.