firebase - Firebase Deploy 在“=>”上获取解析错误
问题描述
当我进入 firebase deploy --only 功能
终端与我的代码存在问题:
amazon-clone-app\amazon-clone\functions\index.js 18:55 错误解析错误:意外令牌 =>
这是我的 eslintrc.js 文件:
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"google",
],
rules: {
quotes: ["error", "double"],
},
};
这是我在终端报告错误函数处的 index.js 文件:
app.post("/payments/create", async (request, response) => {
const total = request.query.total;
const paymentIntent = await stripe.paymentIntents.create({
amount: total,
currency: "usd",
});
response.status(201).send({
clientSecret: paymentIntent.client_secret,
});
});
解决方案
希望这对你有用,就像对我自己一样。在 firebase.json 文件中,您必须将其更改为此。将 % 添加到这个 "%$RESOURCE_DIR%. 之后,firebase deploy --only 功能起作用。
"functions": {
"predeploy": [
"npm --prefix \"%$RESOURCE_DIR%\" run lint"
],
推荐阅读
- javascript - 如何让我的 slack 机器人读取特定频道中的所有消息(而不仅仅是 app_mention)?
- r - Shiny 应用程序中的“SummaryTools”使用“bootswatch”应用自定义主题
- r - 如何将整数列表输入 SQL 并返回项目数据框
- ios - 视图未使用 SwiftUI 呈现
- ios - iOS 应用插件的应用商店审核指南
- javascript - 下一个和上一个与 jquery
- flutter - 在 Flutter 上设置(和/或删除)状态信息
- javascript - 如何从数据库生成的项目中创建(功能)onclick 按钮?
- r - case_when( ) 函数中的参数 TRUE 有什么作用?
- javascript - Discord bot 出错,因为类扩展值 undefined 不是构造函数或 null