0

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,
  });
});
4

1 に答える 1

0

うまくいけば、これは私自身の場合と同じように機能します。firebase.json ファイルでは、これに変更する必要があります。% をこの "%$RESOURCE_DIR% に追加します。その後、firebase deploy --only 関数が機能しました。

 "functions": {
    "predeploy": [
      "npm --prefix \"%$RESOURCE_DIR%\" run lint"
    ],
于 2021-06-09T20:27:44.857 に答える