Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 无法在Alpine Linux上运行节点gdal:"__printf_chk:未找到符号“;_Node.js_Gitlab Ci_Gdal_Alpine - Fatal编程技术网

Node.js 无法在Alpine Linux上运行节点gdal:"__printf_chk:未找到符号“;

Node.js 无法在Alpine Linux上运行节点gdal:"__printf_chk:未找到符号“;,node.js,gitlab-ci,gdal,alpine,Node.js,Gitlab Ci,Gdal,Alpine,我正在尝试使用(Node.js bindings for)为我的项目添加Gitlab CI。由于性能原因,CI配置基于Alpine Linux docker映像,但我无法使其正常工作。Gitlab CI作业在运行Node.js脚本时失败,该脚本需要Node gdal,错误如下: internal/modules/cjs/loader.js:718 return process.dlopen(module, path.toNamespacedPath(filename));

我正在尝试使用(Node.js bindings for)为我的项目添加Gitlab CI。由于性能原因,CI配置基于Alpine Linux docker映像,但我无法使其正常工作。Gitlab CI作业在运行Node.js脚本时失败,该脚本需要
Node gdal
,错误如下:

internal/modules/cjs/loader.js:718
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: Error relocating /builds/project-0/node_modules/gdal/lib/binding/node-v64-linux-x64/gdal.node: __printf_chk: symbol not found
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/builds/project-0/node_modules/gdal/lib/gdal.js:12:29)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
这是一个复制的问题,这是一个

有什么解决方案可以在Alpine上使用该库吗?

多亏了相关的问题和答案,我能够通过以下CI配置()构建
节点gdal
链接到Alpine上的共享gdal库:

.gitlab ci.yml

image: node:lts-alpine

stages:
  - test

test:
  stage: test
  before_script:
    - apk add --no-cache bash ca-certificates wget
    - wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
    - wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk
    - apk add glibc-2.29-r0.apk
  script:
    - yarn
    - node index.js
image: node:lts-alpine

stages:
  - test

test:
  stage: test
  before_script:
    - apk add --no-cache bash make gcc g++ python linux-headers udev --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing --repository http://dl-cdn.alpinelinux.org/alpine/edge/main gdal gdal-dev
  script:
    - npm install gdal --build-from-source --shared_gdal
    - node index.js
在Github上创建。