node.js - 如何在 Ubuntu 上安装 Mapnik
问题描述
我不明白出了什么问题。
我创建了一个矢量切片服务器来使用 express.js 渲染切片图层
我正在尝试在 ubuntu 上安装 mapnik(使用 osboxes.org --> Ubuntu Studio 19.10 (64bit) 版本)。
osboxes@osboxes:~/Documents/axis-tile-server$ npm install
> mapnik@4.3.1 install /home/osboxes/Documents/axis-tile-server/node_modules/mapnik
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/mapnik/v4.3.1/node-v79-linux-x64-Release.tar.gz
node-pre-gyp WARN Pre-built binaries not found for mapnik@4.3.1 and node@13.6.0 (node-v79 ABI, glibc) (falling back to source compile with node-gyp)
/bin/sh: 1: mapnik-config: not found
gyp: Call to 'mapnik-config --cflags' returned exit status 127 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:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:321:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.3.0-18-lowlatency
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/osboxes/Documents/axis-tile-server/node_modules/mapnik/lib/binding/mapnik.node" "--module_name=mapnik" "--module_path=/home/osboxes/Documents/axis-tile-server/node_modules/mapnik/lib/binding" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v79"
gyp ERR! cwd /home/osboxes/Documents/axis-tile-server/node_modules/mapnik
gyp ERR! node -v v13.6.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/osboxes/Documents/axis-tile-server/node_modules/mapnik/lib/binding/mapnik.node --module_name=mapnik --module_path=/home/osboxes/Documents/axis-tile-server/node_modules/mapnik/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/osboxes/Documents/axis-tile-server/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:321:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1028:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Linux 5.3.0-18-lowlatency
node-pre-gyp ERR! command "/usr/bin/node" "/home/osboxes/Documents/axis-tile-server/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/osboxes/Documents/axis-tile-server/node_modules/mapnik
node-pre-gyp ERR! node -v v13.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/osboxes/Documents/axis-tile-server/node_modules/mapnik/lib/binding/mapnik.node --module_name=mapnik --module_path=/home/osboxes/Documents/axis-tile-server/node_modules/mapnik/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
npm WARN vectortileserver@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/pm2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mapnik@4.3.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mapnik@4.3.1 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! /home/osboxes/.npm/_logs/2020-01-13T12_33_45_899Z-debug.log
已编辑:使用 Ubuntu Studio 19.10(64 位)
解决方案
推荐阅读
- java - 以编程方式更改 TextStyle
- android - 使用材料设计,如何以编程方式创建材料按钮?
- linux - Linux下的gcc可执行文件在哪里?
- python - (Python) RuntimeWarning: double_scalars """ 中遇到无效值
- c++ - 向量
>v(大小);打印时显示 0 作为值 - c - 重映射函数指针
- android - 当我重建项目时出现错误:不兼容的类型:ModalEvent 无法转换为上下文
- sql - SQL Server 表锁定/阻塞
- amazon-web-services - 如何从 kubernetes 的前端调用 spring api
- php - 使用循环在 Wordpress 中显示 4 个不同的帖子