当前位置: 首页 > 知识库问答 >
问题:

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

郜彦
2023-03-14

在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!");
});

输出:

D:\IOT\DialogFlow\firebase函数

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

我正在部署运行命令npm--prefix的函数/功能/运行lint

functions@lint D:\IOT\DialogFlow\firebase functions\functions eslint。

>

部署完成!

请注意,更新的函数可能需要30秒才能传播。项目控制台:https://console.firebase.google.com/project/fir-functions-22d02/overview

我尝试了以下方法

- 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"
    ]
  }
}

他们都没有工作。

共有1个答案

斜和硕
2023-03-14

我只是删除了代码中的注释,然后再次部署它。成功了!

以下是输出:

functions@lint D:\IOT\DialogFlow\firebase functions\functions eslint。

  • 函数:完成预部署脚本的运行。i函数:确保启用必要的API...
  • 函数:所有必要的API都已启用i函数:准备函数目录上传... i函数:打包函数(53.58 KB)上传
  • 函数:函数文件夹上传成功i函数:创建N个ode.js6个函数helloWorld(us-中心1)... i函数:更新Node.js6个函数helloWorldTwo(us-中心1)...

以下函数在您的项目中找到,但在您的本地源代码中不存在:helloWorldOne(us-Centural1)

如果要重命名函数或更改其区域,建议在删除旧函数之前先创建新函数,以防止事件丢失。有关更多信息,请访问https://firebase.google.com/docs/functions/manage-functions#modify

? 是否继续删除?选择“否”将继续其余的部署。是i函数:删除函数helloWorldOne(us-central1)。。。函数[helloWorldOne(us-central1)]:删除操作成功。函数[helloWorld(us-central1)]:创建操作成功。函数URL(helloWorld):https://us-central1-fir-functions-28de9.cloudfunctions.net/helloWorld函数[helloWorldTwo(us-central1)]:更新操作成功。

  • 部署完成!

请注意,要传播更新的函数,最长可能需要30秒。项目控制台:https://console.firebase.google.com/project/fir-functions-28de9/overview

 类似资料:
  • 我正试图通过命令行重新部署战争。我正在尝试: java-classpath"C:/bea/weblogic12c/wlserver_12.1/server/lib/weblogic.jar"weblogic. Deployer-adminurl t3://localhost:7101-user用户名-密码-上传-重新部署-name myapp-source myApp.war-目标myServer

  • 我对gradle和npm都是新手,我正在尝试启动并运行一个Grails3-AngularJS2示例应用程序。 这是应用程序https://github.com/agileorbit/grails3-angular2-starter 当我尝试并运行该应用程序时,我得到以下异常,似乎发生在这里

  • docker部署项目,目录结构如下 web下是三个vue打包后的文件,分别是admin,blog,datascreen web下的Dockerfile配置如下 docker-compose配置如下 docker compose up 运行后,在nginx服务容器中(nginx-container), docker exec -it nginx-container ls /usr/share/ngi

  • =d:\users\pjha\appdata\roaming\npm\node_modules\tty.js\node_modules\ws (node-gyp rebuild 2>builderror.log)(退出0)d:\users\pjha\appdata\roaming\npm\node_modules\tty.js\node_modules\ws>如果未定义npm_config_nod

  • =D:\Users\pjha\AppData\Roaming\npm\node\u modules\tty。js\node\u模块\ws (节点gyp重建2

  • 我可以在Wildfly快速入门中提供的Eclipse中运行这些教程中的大部分: https://github.com/wildfly/quickstart/