Firebase部署问题。正在运行的命令:npm--前缀$RESOURCE\u DIR run lint

Firebase部署问题。正在运行的命令:npm--前缀$RESOURCE\u DIR run lint,firebase,google-cloud-functions,facebook-webhooks,Firebase,Google Cloud Functions,Facebook Webhooks,在firebase项目上部署3个简单函数以开始使用,并在部署后期待它们各自的url,但没有得到url 以下是代码: const functions = require('firebase-functions'); // // Create and Deploy Your First Cloud Functions // // https://firebase.google.com/docs/functions/write-firebase-functions // exports.helloW

在firebase项目上部署3个简单函数以开始使用,并在部署后期待它们各自的url,但没有得到url

以下是代码:

const functions = require('firebase-functions');

// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
//
exports.helloWorldOne = functions.https.onRequest((request, response) => {
response.send("Hello 1 from Firebase!");
});

exports.helloWorldTwo = functions.https.onRequest((request, response) => {
response.send("Hello 2 from Firebase!");
});

exports.helloWorldThree = functions.https.onRequest((request, response) =>{
response.send("Hello 3 from Firebase!");
});
- Deleting "npm --prefix \"$RESOURCE_DIR\" run lint".  

- Deleting complete "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint"
    ]
输出:

const functions = require('firebase-functions');

// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
//
exports.helloWorldOne = functions.https.onRequest((request, response) => {
response.send("Hello 1 from Firebase!");
});

exports.helloWorldTwo = functions.https.onRequest((request, response) => {
response.send("Hello 2 from Firebase!");
});

exports.helloWorldThree = functions.https.onRequest((request, response) =>{
response.send("Hello 3 from Firebase!");
});
- Deleting "npm --prefix \"$RESOURCE_DIR\" run lint".  

- Deleting complete "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint"
    ]
D:\IOT\DialogFlow\firebase函数>firebase部署

==部署到“fir-functions-22d02”

我正在部署功能 运行命令:npm——前缀。/functions/run lint

functions@lint D:\IOT\DialogFlow\firebase functions\functions 埃斯林特

  • 功能:已完成运行predeploy脚本。 i功能:确保启用必要的API
  • 功能:启用所有必要的API i函数:正在准备要上载的函数目录

  • 部署完成

请注意,要传播更新的函数,最长可能需要30秒。 项目控制台:

我尝试了以下方法:

const functions = require('firebase-functions');

// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
//
exports.helloWorldOne = functions.https.onRequest((request, response) => {
response.send("Hello 1 from Firebase!");
});

exports.helloWorldTwo = functions.https.onRequest((request, response) => {
response.send("Hello 2 from Firebase!");
});

exports.helloWorldThree = functions.https.onRequest((request, response) =>{
response.send("Hello 3 from Firebase!");
});
- Deleting "npm --prefix \"$RESOURCE_DIR\" run lint".  

- Deleting complete "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint"
    ]
将代码替换为以下内容:

-  {
  "functions": {
    "predeploy": [
      "npm --prefix ./functions/ run lint"
      "npm --prefix ./functions/ run build"
    ]
  }
}

- {
  "functions": {
    "predeploy": [
      "npm --prefix ./functions/ run lint"
    ]
  }
}

它们都不起作用。

我只是从代码中删除了注释,然后重新部署。成功了

以下是输出

functions@lint D:\IOT\DialogFlow\firebase functions\functions 埃斯林特

  • 功能:已完成运行predeploy脚本。 i功能:确保启用必要的API
  • 功能:启用所有必要的API i函数:正在准备要上载的函数目录。。。 i函数:用于上传的打包函数(53.58 KB)
  • 功能:已成功上载功能文件夹 i函数:创建Node.js 6函数helloWorld(us-central1)。。。 i函数:更新Node.js 6函数helloWorldTwo(us-central1)
在您的项目中可以找到以下功能,但在本地 源代码: helloWorldOne(美国中央一级)

如果要重命名函数或更改其区域,建议在删除旧函数之前先创建新函数,以防止事件丢失。有关更多信息,请访问

??是否继续删除?选择“否”将继续执行其余操作 f部署。对 i函数:删除函数helloWorldOne(us-central1)。。。 +函数[helloWorldOne(us-central1)]:删除操作成功。 +函数[helloWorld(us-central1)]:创建操作成功。 函数URL(helloWorld): +函数[helloWorldTwo(us-central1)]:更新操作成功

  • 部署完成
请注意,要传播更新的函数,最长可能需要30秒。
项目控制台:

您的函数很可能未被识别为HTTP触发函数。如果您希望获得有关疑难解答的帮助,请在问题中添加最少的代码(下面有一个编辑链接)。