小编Bor*_*gan的帖子

Google Cloud Functions:require(...)不是函数

我正在尝试部署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')();
Run Code Online (Sandbox Code Playgroud)

但是我在部署时收到以下消息:

Detailed stack trace: TypeError: require(...) is not a function
Run Code Online (Sandbox Code Playgroud)

这仅在@ google-cloud / speech和@ google-cloud / language模块中发生,@ google-cloud / storage模块作为函数正常加载(我通过评论前两个函数进行了测试)。

任何建议将不胜感激。

博里根

api function speech google-cloud-platform google-cloud-functions

6
推荐指数
2
解决办法
2842
查看次数