Grpc版本: 1.24.2
在部署我的Node.js应用程序时,我遇到了grpc包二进制文件的问题。
错误:
Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v83-linux-x64-musl
Found: [node-v72-linux-x64-musl]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module '/app/node_modules/grpc/src/node/extension_binary/node-v83-linux-x64-musl/grpc_node.node'我在Dockerfile中尝试了以下命令:
npm rebuildnpm install --unsafe-permnpm install --target=13.0.0 --target_platform=linux --target_arch=x64Dockerfile (在这里发现的):
FROM node:lts-alpine
WORKDIR /app
COPY package*.json ./
RUN apk add --no-cache --virtual .gyp \
python \
make \
g++ \
&& npm install \
&& apk del .gyp gcc g++ python
COPY . .
RUN npm run build
EXPOSE 9080
CMD ["npm", "start"]此外,我试图配置二进制文件的位置,但没有找到节点-v83-linux-x64-musl。配置二进制文件位置
相关问题:
我需要你的帮助!- murgatroid99
发布于 2020-06-04 17:12:14
模块版本83对应于Node 14,而不是13。不幸的是,我们还没有发布Node 14的二进制文件,所以很难做到这一点。
完整答案- https://github.com/grpc/grpc-node/issues/1460#issuecomment-638965479
https://stackoverflow.com/questions/62197778
复制相似问题