【发布时间】:2018-04-19 08:39:24
【问题描述】:
我正在尝试部署一个 Google Cloud 功能,我首先将初始要求添加到我的 index.js 文件中:
// Import the Google Cloud client libraries
const nl = require('@google-cloud/language')();
const speech = require('@google-cloud/speech')();
const storage = require('@google-cloud/storage')();
但我在部署时收到以下消息:
Detailed stack trace: TypeError: require(...) is not a function
这只发生在 @google-cloud/speech 和 @google-cloud/language 模块上,@google-cloud/storage 模块作为一个函数加载得很好(我通过评论前两个进行了测试)。
任何建议将不胜感激。
博里根
【问题讨论】:
-
有这方面的消息吗?面临同样的问题。
-
我发现至少语言包使用了环境变量
标签: function api google-cloud-platform google-cloud-functions speech