Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node-v59-linux-x64/grpc_node.node is missing

I am trying to use Firebase admin SDK in my server. When I deploy I get the error I am missing file node-v59-linux-x64/grpc_node.node in firebase-admin node_module map. I added "grpc": "1.7.1" in my package, but I still do not get that file after NPM update. I get an older version, node-v57. I also checked this path https://registry.npmjs.org/grpc/-/grpc-1.7.1.tgz, but I could not locate the file. I deleted my node_modules map and ran npm install again, still no node-v59.

How/where can I download that file? Is there any one who can put the file here so I can manually add it?

Error: Cannot find module '/data/app/node_modules/grpc/src/node/extension_binary/node-v59-linux-x64/grpc_node.node'

like image 677
NoKey Avatar asked Nov 16 '17 19:11

NoKey


2 Answers

This kind of problem is usually caused by installing the library on one system, then deploying and running it on a different system that requires a different binary file.

The simplest solution to this problem is to run npm rebuild after deployment on the system you deployed on.

Alternatively, if npm rebuild is not an option, you can pre-install the binary for the system you are deploying on by running npm install with some extra options. The --target argument allows you to install for a different version of Node. An argument of --target=9.0.0 installs the binary for Node 9 (only the major version has to match). The --target_platform argument allows you to install for a specific operating system: windows, linux, or darwin (Mac). The --target_arch argument lets you install for a different processor architecture: ia32, x64, or arm. And finally, the --target_libc argument lets you select binaries built for a different libc: glibc or musl (for Alpine Linux).

So, in your case, you should be able to get that binary by running

npm install --target=9.0.0 --target_platform=linux --target_arch=x64
like image 99
murgatroid99 Avatar answered Sep 23 '22 11:09

murgatroid99


I had the same problem. You can download the file here: https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.1/node-v59-linux-x64.tar.gz

like image 37
J. Doe Avatar answered Sep 22 '22 11:09

J. Doe