polygon-city / polygon-city-cli

Converts a CityGML file into GeoJSON footprint indexes and 3D models (obj & collada)
6 stars 1 forks source link

Cannot find module 'bull' when installing -g #1

Closed meetar closed 8 years ago

meetar commented 8 years ago
Error: Cannot find module 'bull'
    at Function.Module._resolveFilename (module.js:327:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:355:17)
    at require (internal/module.js:13:17)
    at Object.<anonymous> (/Users/peter/work/polygon-city-cli/queues/buildingObj.js:1:13)
    at Module._compile (module.js:399:26)
    at Object.Module._extensions..js (module.js:406:10)
    at Module.load (module.js:345:32)
    at Function.Module._load (module.js:302:12)
    at Function.Module.runMain (module.js:431:10)
module.js:329
    throw err;

…but when I npm install and run it (either with polygon-city or directly with ./index.js, the module is found and the command runs. ¯_(ツ)_/¯

robhawkes commented 8 years ago

That's so odd, especially as it only occurs in the ./queues/buildingObj.js file – seeing as bull is used in nearly all other files and those files are loaded / run before this one.

Running npm install shouldn't affect the polygon-city command because they're installed in different locations, unless global modules look in the current directory if they can't find a module (not sure).

I checked my global install directory and it seems to have bull installed – does yours show the same (directory may be different)?

$ ls -lah /usr/local/lib/node_modules/polygon-city-cli/node_modules

What happens if you fully uninstall the global module and install the latest version (0.1.3)?

$ npm uninstall -g polygon-city-cli
$ npm install -g polygon-city-cli@latest
robhawkes commented 8 years ago

I just noticed that the path in the error doesn't look like the directory that global NPM packages should be installed in – you don't even need to have the repo on your machine to install this.

What exactly are the chain of commands that lead you to this issue?

meetar commented 8 years ago

As far as I can tell, the local module is being found as a fallback somehow. And a clean reinstall doesn't seem to help.

The chain of commands:

redis-server
npm install -g polygon-city-cli@latest
polygon-city -e 31255 -m "elevation-key-here" -o ./output

a_00_10_Lod2.gml

On Wed, Dec 16, 2015 at 5:12 AM, Robin Hawkes notifications@github.com wrote:

I just noticed that the path in the error doesn't look like the directory that global NPM packages should be installed in – you don't even need to have the repo on your machine to install this.

What exactly are the chain of commands that lead you to this issue?

— Reply to this email directly or view it on GitHub https://github.com/polygon-city/polygon-city-cli/issues/1#issuecomment-165055950 .

robhawkes commented 8 years ago

I've just pushed 0.1.4 which should fix this – the problem was that I was requiring modules relative to the directory that the command was being run from, rather than looking for them in the directory that NPM installed everything to.

Let me know if you still see the issue with 0.1.4