繁体   English   中英

在 linux/arm64 上为节点安装 gRPC 工具

[英]Install gRPC tools for node on linux/arm64

无法在 linux/arm64 上为节点安装 grpc-tools。

重现步骤,

与 Dockerfile 一样

FROM node:latest

RUN apt-get update \
    && apt install -y curl ca-certificates curl gnupg \
    && npm -g install grpc-tools

CMD [ "grpc_tools_node_protoc" ]

docker build docker buildx build --platform=linux/arm64 --load -t kameshsampath/protoc-node -f docker/Dockerfile.node.protoc. 失败并出现错误,例如

#0 12.33 npm notice 
#0 12.33 npm notice New major version of npm available! 8.19.2 -> 9.1.1
#0 12.33 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.1.1>
#0 12.33 npm notice Run `npm install -g npm@9.1.1` to update!
#0 12.33 npm notice 
#0 12.33 npm ERR! code 1
#0 12.33 npm ERR! path /usr/local/lib/node_modules/grpc-tools
#0 12.33 npm ERR! command failed
#0 12.33 npm ERR! command sh -c -- node-pre-gyp install
#0 12.33 npm ERR! response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.3/linux-arm64.tar.gz
#0 12.33 npm ERR! node-pre-gyp info it worked if it ends with ok
#0 12.33 npm ERR! node-pre-gyp info using node-pre-gyp@1.0.10
#0 12.33 npm ERR! node-pre-gyp info using node@19.0.1 | linux | arm64
#0 12.33 npm ERR! node-pre-gyp info check checked for "/usr/local/lib/node_modules/grpc-tools/bin/grpc_tools.node" (not found)
#0 12.33 npm ERR! node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.3/linux-arm64.tar.gz
#0 12.33 npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.3/linux-arm64.tar.gz 
#0 12.33 npm ERR! node-pre-gyp ERR! install error 
#0 12.33 npm ERR! node-pre-gyp ERR! stack Error: response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.3/linux-arm64.tar.gz
#0 12.33 npm ERR! node-pre-gyp ERR! stack     at /usr/local/lib/node_modules/grpc-tools/node_modules/@mapbox/node-pre-gyp/lib/install.js:67:15
#0 12.33 npm ERR! node-pre-gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
#0 12.33 npm ERR! node-pre-gyp ERR! System Linux 5.15.49-linuxkit
#0 12.33 npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/grpc-tools/node_modules/.bin/node-pre-gyp" "install"
#0 12.33 npm ERR! node-pre-gyp ERR! cwd /usr/local/lib/node_modules/grpc-tools
#0 12.33 npm ERR! node-pre-gyp ERR! node -v v19.0.1
#0 12.33 npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.10
#0 12.34 npm ERR! node-pre-gyp ERR! not ok
#0 12.34 
#0 12.34 npm ERR! A complete log of this run can be found in:
#0 12.34 npm ERR!     /root/.npm/_logs/2022-11-13T13_28_37_399Z-debug-0.log
------
Dockerfile.node.protoc:3
--------------------
   2 |     
   3 | >>> RUN apt-get update \
   4 | >>>     && apt install -y curl ca-certificates curl gnupg \
   5 | >>>     && npm -g install grpc-tools
   6 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update     && apt install -y curl ca-certificates curl gnupg     && npm -g install grpc-tools" did not complete successfully: exit code: 1

相同的构建适用于linux/amd64

有什么技巧/线索可以克服这个问题吗?

没有用于 arm64 的预编译二进制文件( 问题)。 因为 GRPC-Tools 只是构建工具,在运行时不是必需的,所以您可以在不同的体系结构上使用 grpc-tools 并复制编译后的文件,或者您自己编译二进制文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM