0
votes

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

2 Answers

1
votes

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!

0
votes

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.