0

I updated Brew then updated Node from 10.12.0 -> 13.8.0

Now, I get the following error when trying to deploy a Google Cloud Function

firebase deploy --only functions:createJWT

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-v79-darwin-x64-unknown Found: [node-v64-darwin-x64-unknown] This problem can often be fixed by running "npm rebuild" on the current system Original error: Cannot find module '/Users/.../cloud-functions/functions/node_modules/grpc/src/node/extension_binary/node-v79-darwin-x64-unknown/grpc_node.node' Require stack: - /Users/.../cloud-functions/functions/node_modules/grpc/src/grpc_extension.js - /Users/.../cloud-functions/functions/node_modules/grpc/src/client_interceptors.js - /Users/.../cloud-functions/functions/node_modules/grpc/src/client.js - /Users/.../cloud-functions/functions/node_modules/grpc/index.js - /Users/.../cloud-functions/functions/node_modules/@google-cloud/common-grpc/src/service.js - /Users/.../cloud-functions/functions/node_modules/@google-cloud/common-grpc/src/operation.js - /Users/.../cloud-functions/functions/node_modules/@google-cloud/common-grpc/src/index.js - /Users/.../cloud-functions/functions/node_modules/@google-cloud/logging/src/index.js - /Users/.../cloud-functions/functions/index.js - /usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js

Try running "npm install" in your functions directory before deploying.

Tried npm rebuild and npm install in my functions directory and nothing works

Furthermore...could this issue be due to the fact that GCF Node runtime enviroment is Node10 and I have installed Node13 on my machine? - according to these docs:

https://cloud.google.com/functions/docs/concepts/nodejs-10-runtime

I am struggling to revert back to Node10, have tried by running brew install node@10 and get this:

enter image description here

Then tried running the following command as per output above to symlink it to /usr/local but still no luck

echo 'export PATH="/usr/local/opt/node@10/bin:$PATH"' >> ~/.bash_profile

2 Answers 2

1

Searching around about this error, indeed, this seems that the problem is related to your system waiting for a version and founding another one - as per this part of the error.

Error: Error parsing triggers: Failed to load gRPC binary module because it was not installed for the current system Expected directory: node-v79-darwin-x64-unknown Found: [node-v64-darwin-x64-unknown]

There are some options that you can give it a try, besides trying the npm rebuild. Another option might be updating the package.json - as per this case solved here - that would return your npm version to an old one.

Besides that, on this question in the Community, there are a few solutions that helped other users, that I would recommend you to take a look at it: NodeJs Error - Failed to load gRPC binary module because it was not installed for the current system Expected directory?

Let me know if the information helped you!

Sign up to request clarification or add additional context in comments.

5 Comments

my package.json specifies "node": "10" if I change to 12 I get Error: The only valid choices are: {"node": "8"} and {"node": "10"} when I run firebase deploy functions....so correct me if my thinking is wrong, my machine has node 13.8 and trying to deploy to node10 Google env doesnt like it?
Hi, @Roggie checking the official documentation, it seems that Node.js 8 is supported and Node.js 10 is still in Beta. This confirms that indeed, Cloud Functions don't support Node.js 13 is supported yet. I would recommend you to raise a feature request for it here, for this to be checked by Google.
yes, trying to deploy from a higher version was the issue, going back to node10.19.0 worked.
Nice! Thanks for confirming that, @Roggie!
@Roggie Please, consider accepting or upvoting my answer, if you think it helped!
0

Trying to deploy to an unsupported Google Function execution environment won't work. According to the google docs the current supported environments are Node8 and Node10(beta), re-installing Node10 worked for me.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.