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
Here is Solutions:
We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.
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.
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:
darwin (Mac). The
--target_arch argument lets you install for a different processor architecture:
arm. And finally, the
--target_libc argument lets you select binaries built for a different libc:
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
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
This helped in my case, based on @murgatroid99’s answer:
npm rebuild --target=8.1.0 --target_platform=linux --target_arch=x64 --target_libc=glibc --update-binary
It downloads the required binary to your
I run macOS X on my dev machine and I’m deploying to AWS Lambda; this keeps both runtime versions installed, which means I can develop and test locally and then deploy to Lambda.
Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂