gpt4 book ai didi

firebase - 无法部署 Firebase Cloud Functions [找不到模块 'protobufjs/minimal']

转载 作者:行者123 更新时间:2023-12-01 05:53:24 24 4
gpt4 key购买 nike

在我更新 firebase-functions 和 firebase-admin 后发生此错误

"firebase-functions": "^2.0.4",
"firebase-admin": "^6.0.0"

完全错误
Error: Error occurred while parsing your function triggers.

Error: Failed to import the Cloud Firestore client library for Node.js. Make sure to install the "@google-cloud/firestore" npm package. Original error: Error: Cannot find module 'protobufjs/minimal'

这是我拥有的所有依赖项
"axios": "^0.18.0",
"compose-middleware": "^4.0.0",
"cors": "^2.8.4",
"cuid": "^1.3.8",
"exponent-server-sdk": "^2.3.1",
"express": "^4.15.4",
"firebase": "^4.13.1",
"firebase-admin": "^6.0.0",
"firebase-functions": "^2.0.4",
"lodash": "^4.17.4",
"moment": "^2.22.2",
"query-string": "^6.1.0"

enter image description here

最佳答案

也许回滚到 v5/v1?您需要的只是云功能和 Firestore 交互。

var admin = require('firebase-admin');
var functions = require('firebase-functions');

下面是我的 package.json 显示的内容,我的东西工作正常:
"firebase-admin": "^5.12.0",
"firebase-functions": "^1.0.2",

关于firebase - 无法部署 Firebase Cloud Functions [找不到模块 'protobufjs/minimal'],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51814141/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com