Search code examples
node.jsdockerfilegrpcgrpc-nodegrpc-web

Expected directory: node-v83-linux-x64-musl. Found: [node-v72-linux-x64-musl]


Grpc version: 1.24.2

When deploying my Node.js app I have a problem with the binary file for grpc package.

Error:

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'

I tried these commands in the Dockerfile:

  • npm rebuild
  • npm install --unsafe-perm
  • npm install --target=13.0.0 --target_platform=linux --target_arch=x64

Dockerfile (found here):

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"]

Also I tried to configure binaries' location, but didn't found node-v83-linux-x64-musl. Configure binaries location

Related Questions:

I need your help! — murgatroid99


Solution

  • Module version 83 corresponds to Node 14, not 13. Unfortunately, we have not yet published binaries for Node 14, so it's going to be difficult to get that working

    Full answer - https://github.com/grpc/grpc-node/issues/1460#issuecomment-638965479