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:
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