【发布时间】:2020-06-03 02:34:35
【问题描述】:
我更新了Brew,然后从10.12.0 -> 13.8.0更新了Node
现在,我在尝试部署 Google Cloud 函数时收到以下错误
firebase deploy --only functions:createJWT
i 函数:准备函数目录 上传中...
错误:解析触发器错误:无法加载 gRPC 二进制模块 因为它没有为当前系统安装预期 目录:node-v79-darwin-x64-unknown 找到: [node-v64-darwin-x64-unknown] 这个问题通常可以通过 在当前系统上运行“npm rebuild”原始错误:不能 查找模块 '/Users/.../cloud-functions/functions/node_modules/grpc/src/node/extension_binary/node-v79-darwin-x64-unknown/grpc_node.node' 需要堆栈: - /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
尝试在您的函数目录中运行“npm install”之前 部署。
在我的函数目录中尝试了npm rebuild 和npm install,但没有任何效果
此外...这个问题可能是由于 GCF Node 运行时环境是 Node10 并且我在我的机器上安装了 Node13 造成的吗? - 根据这些文档:
https://cloud.google.com/functions/docs/concepts/nodejs-10-runtime
我正在努力恢复到 Node10,尝试运行 brew install node@10 并得到这个:
然后尝试根据上面的输出运行以下命令,将其符号链接到/usr/local,但仍然没有运气
echo 'export PATH="/usr/local/opt/node@10/bin:$PATH"' >> ~/.bash_profile
【问题讨论】:
标签: node.js google-cloud-functions