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

Created on 4 Jun 2020  Â·  8Comments  Â·  Source: grpc/grpc-node

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

Most helpful comment

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. You should still be fine with Node 12. If you switch to node:12-alpine, you can install the proper binary file either by running npm rebuild in the Dockerfile (may also need the --unsafe-perm argument), or by running npm install --target=12.0.0 --target_platform=linux --target_arch=x64 --target_libc=musl outside of the docker image.

All 8 comments

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. You should still be fine with Node 12. If you switch to node:12-alpine, you can install the proper binary file either by running npm rebuild in the Dockerfile (may also need the --unsafe-perm argument), or by running npm install --target=12.0.0 --target_platform=linux --target_arch=x64 --target_libc=musl outside of the docker image.

Thank you for your help!

Hi @murgatroid99, is there a place where I can check the currently supported node version?

For now, it's not exactly made to be read by humans, but our build script has a list of the Node and Electron versions that we are building for.

Thanks. I do think exposing this information is vital to developers and can reduce astonishment.

Almost all the time, the answer will be that the latest versions of Node and Electron are supported, with probably a week of leeway after new versions are released. We had a period when our build was not working and we could not publish updates, but I don't think that will happen again.

We keeping getting an error asking for node-v88-linux-x64-glibc which seems to versions above Node.js 15.0.0. Though the latest version available from gcr.io/cloud-builders is Node js 14.10.0.

I've tried
npm install --target=12.0.0 --target_platform=linux --target_arch=x64 --target_libc=musl
within the cloudbuild.yaml to no success.

✔ functions: Finished running predeploy script.
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
✔ functions: required API cloudfunctions.googleapis.com is enabled
✔ functions: required API cloudbuild.googleapis.com is enabled
i functions: preparing functions directory for uploading...

Error: Error parsing triggers: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v88-linux-x64-glibc
Found: [node-v83-linux-x64-glibc]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module '/workspace/functions/node_modules/grpc/src/node/extension_binary/node-v88-linux-x64-glibc/grpc_node.node'

steps:
1# Deploy firebase

  • name: 'gcr.io/$PROJECT_ID/firebase'
    args: [ 'use', '$PROJECT_ID']

2# Packages

  • name: 'gcr.io/cloud-builders/npm:latest'
    dir: 'functions'
    args: ['install']

3# Build

  • name: 'gcr.io/cloud-builders/npm'
    dir: 'functions'
    args: ['rebuild', '--unsafe-perm']

4# Deploy functions

  • name: 'gcr.io/$PROJECT_ID/firebase'
    args: [ 'deploy', '--only', 'functions']

The extended command I suggested was specifically for installing the library on a different system than the one you are deploying it on. If you are installing the library on the same system where you are running it, you should just run npm install.

If you are installing and running the library on different systems, you should use that extended command, but the parameters are specific to the system where you are running the code. In particular, the --target argument needs to be set to the version of Node that you will be running the code on. In this case, the error says that it is looking for node-v88-linux-x64-glibc, and module version 88 corresponds to Node 15, so you need the argument --target=15.0.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

badoet picture badoet  Â·  4Comments

Slapbox picture Slapbox  Â·  5Comments

nhanpiti picture nhanpiti  Â·  3Comments

lucavallin picture lucavallin  Â·  5Comments

Harmonickey picture Harmonickey  Â·  6Comments