maptiler / tileserver-gl

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
https://tileserver.readthedocs.io/en/latest/
Other
2.21k stars 636 forks source link

issues installing dependencies #120

Open mapsgeek opened 7 years ago

mapsgeek commented 7 years ago

errors when installing mapbox-gl-native, for an issue in node-gyp return node-pre-gyp ERR! stack Error: 403 status code downloading tarball https://mapbo x-node-binary.s3.amazonaws.com/mapbox-gl-native/v3.4.2/node-v46-win32-x64.tar.gz

i'm running node 4.2.1 as i noticed in the package.json "node": ">=4.2.1 <5" i tried also running other later versions of node but went through different types of errors related to installing dependencies also and related to the modules that needs node-gyp such as sqlite3

rmrice commented 7 years ago

@mapsgeek before you get recommended to use docker :wink: :

I had the same issue and had to install a lot of dependencies myself, including node-gyp and canvas. Try installing it yourself with npm (npm install -g node-gyp-install)

After that I had to install canvas and all it's dependencies.

I hope that helps. There may have been other dependencies that did not get installed with the tileserver-gl package, but I can't remember them off the top of my head. I think the best move is when it won't run because a dependency is missing is to try to install that dependency separately.

Now I'm getting stuck with libstdc++. The package builds fine, but one node . I'm getting this:

Error: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found 
(required by /tmp/tileserver-gl/node_modules/@mapbox/mapbox-gl-native/lib/mapbox-gl-native.node)

And I found this from the mapbox-gl-native readme:

If you hit a runtime error like `/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.20' not found` 
it means you forgot to upgrade libstdc++6 to at least `v6.1.1`.

I'm working on CentOS 7, and I can't figure out how to upgrade libstdc++ because it doesn't seem like there is an upgrade (latest version is 4.8.5), so I need a workaround. Really hoping to get tileserver-gl working with node!!!

mapsgeek commented 7 years ago

thank you Rebecca i was able to run a docker image successfully, but the thing i bother is that i'm not able to use any of mapbox tiling servers due to this node-pre-gyp errors neither in Ubuntu or windows with different set of versions.

klokan commented 7 years ago

Native windows installation is not supported - TileServer GL can't run on Windows directly because Mapbox GL Native does not compile on Windows (yet). The GL module is simply not possible to compile for Win32/x64. Relevant ticket: https://github.com/mapbox/mapbox-gl-native/issues/6792 (only third-party experimental compilation of MapBox GL Native library on Windows is available).

With native installation on Windows, you can use only the light version of TileServer GL (without rasterization).

Windows Server now natively supports Docker - so with Docker you can get a production deploy on Windows platform too. BTW greetings to @rmrice from @DigitalGlobe. ;-)

If you want to install natively under Linux, then you must be sure you have all the dependencies. The NPM packages are precompiled by Mapbox only for certain versions of node - but we do also compile the Mapbox GL Native in-house - with patches for customers or test for improvements. You can compile the dependencies yourself too.

Basic installation under Linux is described at: http://tileserver.readthedocs.io/en/latest/installation.html#native-dependencies

A step-by-step for Ubuntu 16.03 is visible at https://github.com/klokantech/tileserver-gl/issues/68#issuecomment-261049130 A step-by-step for Debian is visible inside of https://github.com/klokantech/tileserver-gl/blob/master/Dockerfile

If you have a bit of time and an idea for how to guide others to install the software natively, could you please contribute with a Pull Request to the documentation - under https://github.com/klokantech/tileserver-gl/blob/master/docs/installation.rst ? This would be great!

rmrice commented 7 years ago

@klokan I'd be happy to contribute to the documentation on building from source, once I figure out how to get this completely working and document my steps better :smile:

@mapsgeek I had the same missing dependency as you, here are my suggestions:

Forgive me if those instructions are a little disjointed, as I'm using my console's history to remember what I did and was working with CentOS, but I hope that helps somewhat. Before you do this make sure you're compiling tileserver on a supported version of node. I had luck with v4.2.6. It might be worth it to use nvm to switch to that version, wipe your node modules and npm install again.

mapsgeek commented 7 years ago

so after a long time of altering between node version to install canvas , mapbox-gl-native and sqlite3 all 3 dependencies installed and node-gyp build successfully and the app starts to download the sample mbtile file, but then and error Error: Cannot find module '../build/Release/sharp.node' however i see sharp module in the node_modules folder and also installed it manually any clue ?

current machine : ubuntu 16.4 node v 4.2.6

Quynh-Nguyen commented 7 years ago

I got same error

$ node .
Starting tileserver-gl v1.7.0
No MBTiles specified, using zurich_switzerland.mbtiles
Automatically creating config file for zurich_switzerland.mbtiles
Run with --verbose to see the config file here.
module.js:598
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: libcurl-gnutls.so.4: cannot open shared object file: No such file or directory
    at Object.Module._extensions..node (module.js:598:18)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/var/www/html/drone_mapbox/node_modules/@mapbox/mapbox-gl-native/platform/node/index.js:5:12)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)

I already try follow @rmrice tip but not work... :(

ericsvendsen commented 6 years ago

@rmrice did you ever find a way around the libstdc++ problem? I'm trying to build on CentOS 7 too and can't figure it out. I posted a question on SO also so I'm hoping someone out there has some ideas.

pkumar76 commented 6 years ago

Try this sudo ln -s /lib64/libcurl.so.4.3.0 /lib64/libcurl-gnutls.so.4.3.0 sudo ln -s /lib64/libcurl.so.4.3.0 /lib64/libcurl-gnutls.so.4

rmrice commented 6 years ago

Hey @ericsvendsen, I actually made a PR to update the docs. See the instructions I came up with here, it's a bit convoluted :):

https://github.com/rmrice/tileserver-gl/blob/0441685f0db7f890d9510039767a1f66f5e3edbe/docs/installation_centos.rst

rmrice commented 6 years ago

Oh, I just saw you got your answer on stackoverflow! Glad you got it to work! :smile:

ericsvendsen commented 6 years ago

Yes, thanks for checking in, and for your assistance!