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

时间:2018-08-13 01:26:08

标签: firebase google-cloud-functions

我更新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

2 个答案:

答案 0 :(得分:0)

也许回滚到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",

答案 1 :(得分:0)

使用npm installnpm update installing丢失的protobufjs包怎么样……甚至可以显式添加"protobufjs": "^6.8.8"-或使用{{1 }}?