代码之家  ›  专栏  ›  技术社区  ›  siriwatknp

无法部署Firebase云函数[找不到模块protobufjs/minimal']

  •  4
  • siriwatknp  · 技术社区  · 7 年前

    此错误发生在我更新firebase函数和firebase管理之后

    "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 回复  |  直到 7 年前
        1
  •  0
  •   Ronnie Smith    7 年前

    可能会回滚到v5/v1?下面是云功能和firestore交互的全部需求。

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

    下面是my package.json显示的内容,我的东西运行良好:

    "firebase-admin": "^5.12.0",
    "firebase-functions": "^1.0.2",
    
        2
  •  0
  •   Martin Zeitler    7 年前

    怎么样 installing 失踪者 protobufjs npm install npm update ... 甚至可以显式地添加 "protobufjs": "^6.8.8" npm install protobufjs ?

    推荐文章