【问题标题】:⚠ functions: failed to create function add HTTP Error: 400, The request has errors⚠ 函数:未能创建函数添加 HTTP 错误:400,请求有错误
【发布时间】:2019-10-11 03:06:04
【问题描述】:

我有这个 package.json:

{
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "lint": "eslint .",
    "serve": "firebase serve --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "dependencies": {
    "cors": "^2.8.5",
    "firebase-admin": "~7.0.0",
    "firebase-functions": "^2.2.0",
    "nodemailer": "^6.2.1"
  },
  "devDependencies": {
    "eslint": "^5.12.0",
    "eslint-plugin-promise": "^4.0.1"
  },
  "private": true
}

这只是 index.js

"use strict";
const functions = require('firebase-functions');

exports.add = functions.https.onRequest( (req, res) => {
    res.send('Hola mundo')
})

我正在尝试部署此功能,但发生了这种情况

MacBook-Pro-de-Fernando-2:functions xxxxxx$ firebase deploy --only 函数

=== 正在部署到 'yyyyyy-f08c8'...

我正在部署函数运行命令:npm --prefix "$RESOURCE_DIR" run lint

functions@lint /Users/xxxxxx/Desktop/YYYYYY/yyyyyy/functions eslint .

✔ 功能:已完成运行预部署脚本。 i 功能:确保启用必要的 API... ✔ 功能:启用所有必要的 API : 创建函数添加... ⚠ 函数: 未能创建函数添加 HTTP 错误: 400, 请求有错误

函数部署有错误。要继续部署其他功能(例如数据库),请运行: firebase deploy --except functions

错误:函数未正确部署。

谁能帮帮我?谢谢

【问题讨论】:

    标签: function cloud


    【解决方案1】:

    它发生在我身上,并由以下人员修复:

    npm install -g firebase-tools@latest
    

    【讨论】:

      猜你喜欢
      • 2019-11-05
      • 2018-03-30
      • 2020-10-16
      • 2021-05-21
      • 2017-08-10
      • 1970-01-01
      • 1970-01-01
      • 2019-10-01
      • 1970-01-01
      相关资源
      最近更新 更多