mapbox / geojson-mapnikify

Transform GeoJSON objects into Mapnik XML stylesheets with embedded GeoJSON data and simplestyle-spec-derived styles.
ISC License
38 stars 22 forks source link

Unable to install this package #34

Open goodhoko opened 6 years ago

goodhoko commented 6 years ago

I'm unable to install this package on my windows 10 machine. Here's the log after running simply npm install -g @mapbox/geojson-mapnikify

PS C:\Users\goodh\workspace\goout\MapService\src> npm install -g @mapbox/geojson-mapnikify
npm WARN deprecated queue-async@1.0.7: renamed to d3-queue
npm WARN deprecated protozero@1.5.1: protozero should no longer be used via npm, install instead via https://github.com/mapbox/mason
npm WARN deprecated maki@0.5.0: maki is now namespaced, install @mapbox/maki instead
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
C:\Users\goodh\AppData\Roaming\npm\geojson-mapnikify -> C:\Users\goodh\AppData\Roaming\npm\node_modules\@mapbox\geojson-mapnikify\bin\geojson-mapnikify

> mapnik@3.7.2 install C:\Users\goodh\AppData\Roaming\npm\node_modules\@mapbox\geojson-mapnikify\node_modules\mapnik
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/mapnik/v3.7.2/node-v57-win32-x64-Release.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for mapnik@3.7.2 and node@8.11.3 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
'mapnik-config' is not recognized as an internal or external command,
operable program or batch file.
gyp: Call to 'mapnik-config --ldflags' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\goodh\\AppData\\Roaming\\npm\\node_modules\\@mapbox\\geojson-mapnikify\\node_modules\\mapnik\\lib\\binding\\mapnik.node" "--module_name=mapnik" "--module_path=C:\\Users\\goodh\\AppData\\Roaming\\npm\\node_modules\\@mapbox\\geojson-mapnikify\\node_modules\\mapnik\\lib\\binding" "--python=C:\\Users\\goodh\\.windows-build-tools\\python27\\python.exe" "--msvs_version=2015"
gyp ERR! cwd C:\Users\goodh\AppData\Roaming\npm\node_modules\@mapbox\geojson-mapnikify\node_modules\mapnik
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\goodh\AppData\Roaming\npm\node_modules\@mapbox\geojson-mapnikify\node_modules\mapnik\lib\binding\mapnik.node --module_name=mapnik --module_path=C:\Users\goodh\AppData\Roaming\npm\node_modules\@mapbox\geojson-mapnikify\node_modules\mapnik\lib\binding --python=C:\Users\goodh\.windows-build-tools\python27\python.exe --msvs_version=2015' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\goodh\AppData\Roaming\npm\node_modules\@mapbox\geojson-mapnikify\node_modules\mapnik\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Windows_NT 10.0.17134
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\goodh\\AppData\\Roaming\\npm\\node_modules\\@mapbox\\geojson-mapnikify\\node_modules\\mapnik\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\goodh\AppData\Roaming\npm\node_modules\@mapbox\geojson-mapnikify\node_modules\mapnik
node-pre-gyp ERR! node -v v8.11.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\goodh\AppData\Roaming\npm\node_modules\@mapbox\geojson-mapnikify\node_modules\mapnik\lib\binding\mapnik.node --module_name=mapnik --module_path=C:\Users\goodh\AppData\Roaming\npm\node_modules\@mapbox\geojson-mapnikify\node_modules\mapnik\lib\binding --python=C:\Users\goodh\.windows-build-tools\python27\python.exe --msvs_version=2015' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mapnik@3.7.2 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mapnik@3.7.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\goodh\AppData\Roaming\npm-cache\_logs\2018-08-11T08_11_59_364Z-debug.log

I guess it's the same problem as when trying to run this package on RunKit: which also fails.

goodhoko commented 6 years ago

So, I've tried to install this package on ubuntu machine with mapnik installed and it installed ok. However when trying to use the command line binary it throws this:

root@f97998cc2900:/home/renderer/src/openstreetmap-carto# geojson-mapnikify
module.js:549
    throw err;
    ^

Error: Cannot find module '/usr/local/lib/node_modules/@mapbox/geojson-mapnikify/node_modules/mapnik/lib/binding/mapnik_settings.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@mapbox/geojson-mapnikify/node_modules/mapnik/lib/mapnik.js:8:16)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
AlokBansal8 commented 6 years ago

Same problem here trying to install it on Mac. Node version 10.9.0 and npm version 6.4.0.