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.24k stars 639 forks source link

npm install tileserver-gl failed #325

Open azizul-bkash opened 6 years ago

azizul-bkash commented 6 years ago

npm WARN deprecated hoek@2.16.3: The major version is no longer supported. Please update to 4.x or newer npm WARN lifecycle @mapbox/mapbox-gl-native@3.5.4~preinstall: cannot run in wd %s %s (wd=%s) @mapbox/mapbox-gl-native@3.5.4 npm install node-pre-gyp /usr/lib/node_modules/.staging/@mapbox/mapbox-gl-native-6eb8f479 /usr/bin/tileserver-gl -> /usr/lib/node_modules/tileserver-gl/src/main.js

sqlite3@4.0.3 install /usr/lib/node_modules/tileserver-gl/node_modules/sqlite3 node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download [sqlite3] Success: "/usr/lib/node_modules/tileserver-gl/node_modules/sqlite3/lib/binding/node-v48-linux-x64/node_sqlite3.node" is installed via remote

@mapbox/mapbox-gl-native@3.5.4 install /usr/lib/node_modules/tileserver-gl/node_modules/@mapbox/mapbox-gl-native node-pre-gyp install --fallback-to-build=false || make node

[@mapbox/mapbox-gl-native] Success: "/usr/lib/node_modules/tileserver-gl/node_modules/@mapbox/mapbox-gl-native/lib/mapbox_gl_native.node" is installed via remote

canvas@1.6.12 install /usr/lib/node_modules/tileserver-gl/node_modules/canvas node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.14.4" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/tileserver-gl/node_modules/canvas/.node-gyp" ./util/has_lib.sh: 31: ./util/has_lib.sh: pkg-config: not found gyp: Call to './util/has_lib.sh freetype' returned exit status 0 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 (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12) gyp ERR! System Linux 4.4.0-1066-aws gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/lib/node_modules/tileserver-gl/node_modules/canvas gyp ERR! node -v v6.14.4 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok /usr/lib └── (empty)

npm ERR! Linux 4.4.0-1066-aws npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "tileserver-gl" npm ERR! node v6.14.4 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE

npm ERR! canvas@1.6.12 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the canvas@1.6.12 install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the canvas package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs canvas npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls canvas npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /opt/vectormaps/npm-debug.log npm ERR! code 1

bdsoha commented 6 years ago

Apparently you can only use Node v6

Make sure you have Node.js version 6 installed (running node -v it should output something like v6.11.3).

azizul-bkash commented 6 years ago

6.14.4

Adraesh commented 6 years ago

Hi all, same issue here, same node version used. Any news? Thanks!

james-berry commented 6 years ago

node -v => 6.11.3 here

no such file or directory, rename '/Users/user/.nvm/versions/node/v6.11.3/lib/node_modules/.staging/@mapbox/point-geometry-5f956679' -> '/Users/user/.nvm/versions/node/v6.11.3/lib/node_modules/tileserver-gl/node_modules/@mapbox/point-geometry'

dobrildobrilov commented 6 years ago

npm_config_user=root npm install -g tileserver-gl

azizul-bkash commented 6 years ago

@dobrildobrilov Perfect installation....But after installation when I am trying to run the following command with custom mbtiles its returning following wrror

admin@gisserver:/opt/maps$ sudo tileserver-gl aaa.mbtiles
Starting tileserver-gl v2.4.0
Automatically creating config file for aaa.mbtiles
WARN: MBTiles not in "openmaptiles" format. Serving raw data only...
Run with --verbose to see the config file here.
module.js:604
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: libGLESv2.so.2: cannot open shared object file: No such file or directory
    at Error (native)
    at Object.Module._extensions..node (module.js:604:18)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/lib/node_modules/tileserver-gl/node_modules/@mapbox/mapbox-gl-native/platform/node/index.js:5:12)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
alex2wong commented 6 years ago

@azizul-bkash maybe you can try

apt search libGLES

then apt install the package you need, this package libgles2-mesa is about OpenGL API

image

tobwen commented 6 years ago

npm_config_user=root npm install -g tileserver-gl

This also did it for me, thanks a lot. Could anyone add it to Readme please?

tobwen commented 6 years ago

then apt install the package you need, this package libgles2-mesa is about OpenGL API

I had the same problem, but now also libegl-mesa0 needs to be installed. So these are needed on Debian Stretch: apt install libgles2-mesa libegl1-mesa

amosfolz commented 6 years ago

I have tried everything listed here and still get the error. Any other ideas?

hamham91 commented 5 years ago

I am also having this issue.

My process was:

The output was:

npm ERR! Linux 4.15.0-1021-aws
npm ERR! argv "/home/ubuntu/.nvm/versions/node/v6.14.4/bin/node" "/home/ubuntu/.nvm/versions/node/v6.14.4/bin/npm" "install" "-g" "tileserver-gl"
npm ERR! node v6.14.4
npm ERR! npm  v3.10.10
npm ERR! path /home/ubuntu/.nvm/versions/node/v6.14.4/lib/node_modules/.staging/@mapbox/point-geometry-0bb7a5e2
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/home/ubuntu/.nvm/versions/node/v6.14.4/lib/node_modules/.staging/@mapbox/point-geometry-0bb7a5e2' -> '/home/ubuntu/.nvm/versions/node/v6.14.4/lib/node_modules/tileserver-gl/node_modules/@mapbox/point-geometry'
npm ERR! enoent ENOENT: no such file or directory, rename '/home/ubuntu/.nvm/versions/node/v6.14.4/lib/node_modules/.staging/@mapbox/point-geometry-0bb7a5e2' -> '/home/ubuntu/.nvm/versions/node/v6.14.4/lib/node_modules/tileserver-gl/node_modules/@mapbox/point-geometry'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/npm-debug.log
npm ERR! code 1

The same output occurs when I run npm_config_user=root npm install -g tileserver-gl.

StefanAtUeber commented 5 years ago

Try using the exact node version 6.11.3 and uninstall/reinstall the tileserver-gl package via npm.

Worked for me under Ubuntu 16.04.5 LTS

hamham91 commented 5 years ago

@StefanAtUeber thanks for responding, but I am seeing the same result using version 6.11.3

npm ERR! Linux 4.15.0-1021-aws
npm ERR! argv "/home/ubuntu/.nvm/versions/node/v6.11.3/bin/node" "/home/ubuntu/.nvm/versions/node/v6.11.3/bin/npm" "install" "-g" "tileserver-gl"
npm ERR! node v6.11.3
npm ERR! npm  v3.10.10
npm ERR! path /home/ubuntu/.nvm/versions/node/v6.11.3/lib/node_modules/.staging/@mapbox/point-geometry-b1dea8e6
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/home/ubuntu/.nvm/versions/node/v6.11.3/lib/node_modules/.staging/@mapbox/point-geometry-b1dea8e6' -> '/home/ubuntu/.nvm/versions/node/v6.11.3/lib/node_modules/tileserver-gl/node_modules/@mapbox/point-geometry'
npm ERR! enoent ENOENT: no such file or directory, rename '/home/ubuntu/.nvm/versions/node/v6.11.3/lib/node_modules/.staging/@mapbox/point-geometry-b1dea8e6' -> '/home/ubuntu/.nvm/versions/node/v6.11.3/lib/node_modules/tileserver-gl/node_modules/@mapbox/point-geometry'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/npm-debug.log
npm ERR! code 1
StefanAtUeber commented 5 years ago

Can you please check that you use the root user, not the ubuntu user? Cause all of your paths are within the home directory of user ubuntu, which is default on aws.

Fa7C0n commented 5 years ago

I am also facing the same problem even when I run npm_config_user=root npm install -g tileserver-gl

Cause of the Failure

I am using node v6.17.3 in a Ubuntu16.04 machine and when I tried to install tileserver-gl via npm using npm install -g tileserver-gl it fails with the following error

npm ERR! canvas@1.6.13 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@1.6.13 install script 'node-gyp rebuild'.
error stacktrace ``` > sqlite3@4.0.8 install /home/cropin/.nvm/versions/node/v6.11.3/lib/node_modules/tileserver-gl/node_modules/sqlite3 > node-pre-gyp install --fallback-to-build node-pre-gyp WARN Using request for node-pre-gyp https download [sqlite3] Success: "/home/cropin/.nvm/versions/node/v6.11.3/lib/node_modules/tileserver-gl/node_modules/sqlite3/lib/binding/node-v48-linux-x64/node_sqlite3.node" is installed via remote > @mapbox/mapbox-gl-native@4.0.0 install /home/cropin/.nvm/versions/node/v6.11.3/lib/node_modules/tileserver-gl/node_modules/@mapbox/mapbox-gl-native > node-pre-gyp install --fallback-to-build=false || make node node-pre-gyp WARN Using request for node-pre-gyp https download [@mapbox/mapbox-gl-native] Success: "/home/cropin/.nvm/versions/node/v6.11.3/lib/node_modules/tileserver-gl/node_modules/@mapbox/mapbox-gl-native/lib/node-v48/mbgl.node" is installed via remote > canvas@1.6.13 install /home/cropin/.nvm/versions/node/v6.11.3/lib/node_modules/tileserver-gl/node_modules/canvas > node-gyp rebuild make: Entering directory '/home/cropin/.nvm/versions/node/v6.11.3/lib/node_modules/tileserver-gl/node_modules/canvas/build' SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node COPY Release/canvas-postbuild.node CXX(target) Release/obj.target/canvas/src/Canvas.o In file included from ../src/Canvas.cc:20:0: ../src/JPEGStream.h:10:21: fatal error: jpeglib.h: No such file or directory compilation terminated. canvas.target.mk:120: recipe for target 'Release/obj.target/canvas/src/Canvas.o' failed make: *** [Release/obj.target/canvas/src/Canvas.o] Error 1 make: Leaving directory '/home/cropin/.nvm/versions/node/v6.11.3/lib/node_modules/tileserver-gl/node_modules/canvas/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/home/cropin/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12) gyp ERR! System Linux 4.4.0-94-generic gyp ERR! command "/home/cropin/.nvm/versions/node/v6.11.3/bin/node" "/home/cropin/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/cropin/.nvm/versions/node/v6.11.3/lib/node_modules/tileserver-gl/node_modules/canvas gyp ERR! node -v v6.11.3 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok /home/cropin/.nvm/versions/node/v6.11.3/lib `-- (empty) npm ERR! Linux 4.4.0-94-generic npm ERR! argv "/home/cropin/.nvm/versions/node/v6.11.3/bin/node" "/home/cropin/.nvm/versions/node/v6.11.3/bin/npm" "install" "-g" "tileserver-gl" npm ERR! node v6.11.3 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! canvas@1.6.13 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the canvas@1.6.13 install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the canvas package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs canvas npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls canvas npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /home/cropin/Documents/npm-debug.log npm ERR! code 1 ```

But I can install tileserver-gl-light without any error using npm. I followed the instructions from here

To reproduce

petrsloup commented 5 years ago

@Fa7C0n you are missing node-canvas dependencies, so it does not compile. See https://github.com/Automattic/node-canvas/tree/v1.x#installation

Fa7C0n commented 5 years ago

@petrsloup Thanks for the help, it worked after installing canvas.