繁体   English   中英

在创建 iOS 和 firebase 时创建条带客户时出错

[英]error creating stripe customer on create iOS and firebase

当用户在我的 IOS 应用程序上创建帐户时,我正在尝试创建条纹客户。 当我运行命令firebase deploy --only functions ,我的所有功能都崩溃了。 但是当我删除

const logging = require('@google-cloud/logging');
const stripe = require('stripe')(functions.config().stripe.token);
const currency = functions.config().stripe.currency || 'USD';



  exports.createStripeCustomer = functions.auth.user().onCreate((user) => {
  return stripe.customers.create({
  email: user.email,
  }).then((customer) => {
    return admin.database().ref(`/stripe_customers/${user.uid}/customer_id`).set(customer.id);
  });
});

我收到错误

函数加载用户代码失败。 错误消息:错误:请检查您的函数日志以查看错误原因: https : //cloud.google.com/functions/docs/monitoring/logging#viewing_logs

在完成我的代码之后,我将它缩小到这些行。 当我删除三个 const 时,我收到相同的错误。 如果我删除导出并保留常量,同样的事情。 我的功能只有在我删除所有这些时才会推送。 有什么我想念的吗? 我见过类似的问题,这里的答案与我的代码相似,所以我很困惑。 我正在检查我的日志,它不是描述性的,它只是重复相同的消息。

我在 firebase 函数中收到的日志消息是,

详细的堆栈跟踪:错误:找不到模块“@google-cloud/logging”

如果要使用模块,则必须在部署之前先安装它。 从原始 package.json 所在的函数文件夹中:

npm install @google-cloud/logging

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM