TypeError:functions.pubsub.schedule不是函数

时间:2019-08-11 01:45:52

标签: firebase

在firebase上部署预定功能时遇到此问题:

Error: Error occurred while parsing your function triggers.

TypeError: functions.pubsub.schedule is not a function
    at Object.<anonymous> (/Users/alacret/workspace/kadem-functions/functions/index.js:12:46)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at /usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:15:15
    at Object.<anonymous> (/usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:53:3)

1 个答案:

答案 0 :(得分:0)

在互联网上搜索了一段时间后,我找不到答案,甚至没有查看Firebase文档:

https://firebase.google.com/docs/functions/schedule-functions

问题出在我的firebase-functions版本上,我将其设置为:

firebase-functions:2.2.0

,它必须至少在您的package.json上为2.3.0