我有一个部署了多个功能的firebase项目.是否可以通过CLI删除所有功能?
我尝试了命令firebase functions:delete --region us-central1
,错误输出是Error: Must supply at least function or group name.
截至目前,我删除了所有这些,并指定了每个名称:
firebase functions:delete function1 function2 ...functionN但这非常麻烦.
安装的firebase-tools版本是v4.0.0
正如标题所暗示的那样,我无法升级或以任何方式从我的系统中删除当前版本的 firebase,我不明白为什么。我使用首次启动项目时提示的 firebase 命令安装它,符合npm install -g firebase-tools. 在我安装了其他软件包之后,我相应地升级了这些软件包。
现在我想删除这个包,我只是不明白该怎么做。我跑了
npm uninstall -g firebase-tools
npm uninstall -g firebase-admin
npm uninstall -g firebase-functions
npm uninstall -g firebase*
...以及许多其他变体。经过一段时间的尝试,我只是想我会检查可能还剩下哪些包。
npm ls | grep firebase
显示仍然没有安装 firebase 软件包,但是,运行任何 firebase 命令仍然可以正常工作。运行firebase --version我得到3.15.4。我也,就像一个万福玛丽一样,试着跑步apt remove --purge firebase*
进一步挖掘我认为可能npm ls命令已关闭,因此我尝试重新安装所有 firebase 软件包。我再次运行它,它们就在那里,但是* firebase 现在是版本4.12.1。运行firebase --version仍然产生3.15.4。
我真的迷失在这一点上。所有与卸载 firebase 相关的帮助文章都指向如何删除项目或数据库或 npm 如何卸载软件包网站。
真挚地。
我有一个在 firebase 托管上运行 javascript 的小型前端项目,每次运行之前我都必须手动调用构建脚本firebase deploy。所以我一直在寻找一种方法将它放在预部署脚本中,但 firebase CLI 文档中没有这样的东西。所以有人知道如何完成它吗?
当我跑步时firebase deploy命令时,我想知道部署了哪些文件。
我试过firebase deploy --debug,但没有看到有关上传文件的任何信息。
[2018-05-25T09:48:26.423Z] ----------------------------------------------------------------------\n[2018-05-25T09:48:26.426Z] Command: /usr/local/bin/node /usr/local/bin/firebase deploy --debug\n[2018-05-25T09:48:26.427Z] CLI Version: 3.18.4\n[2018-05-25T09:48:26.427Z] Platform: darwin\n[2018-05-25T09:48:26.427Z] Node Version: v9.2.0\n[2018-05-25T09:48:26.428Z] Time: Fri May 25 2018 11:48:26 GMT+0200 (CEST)\n[2018-05-25T09:48:26.428Z] ----------------------------------------------------------------------\n\n[2018-05-25T09:48:26.439Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]\n[2018-05-25T09:48:26.440Z] > authorizing via signed-in user\n[2018-05-25T09:48:26.441Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]\n[2018-05-25T09:48:26.442Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token \n { refresh_token: \'1/sNSNg7xxbzwVujBEzRAQ2eZHkEuT0d6A2jVVUGa-e9Jgrc8NASizU4RK7MEmNnov\',\n client_id: \'563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com\',\n client_secret: \'j9iVZfS8kkCEFUPaAeJV0sAi\',\n grant_type: \'refresh_token\',\n scope: \'email https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid\' } \n Fri May 25 2018 11:48:26 …Run Code Online (Sandbox Code Playgroud) 我已经设置了一个Firebase项目来创建一些基本的Firebase功能.
在我正在使用TypeScript的项目中
在Firebase官方文档之后,我创建了我的项目.
最后一步,firebase deploy --only functions该tsc命令出错.
$ firebase deploy --only functions
=== Deploying to ‘my-project’…
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions@ lint /path/to/functions
> tslint --project tsconfig.json
Running command: npm --prefix "$RESOURCE_DIR" run build
> functions@ build /path/to/functions
> tsc
node_modules/firebase-functions/lib/function-builder.d.ts(60,95): error TS1005: ';' expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,96): error TS1003: Identifier expected.
node_modules/firebase-functions/lib/function-builder.d.ts(60,116): error TS1005: ';' expected.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: …Run Code Online (Sandbox Code Playgroud) node.js firebase typescript google-cloud-functions firebase-cli
当在本地 Firestore 和函数模拟器上运行我的 Firestore 触发器时,它们实际上不会触发。有时我让它们触发,但随后我做了一些小改变,一切都突然停止工作。
\n\n我的模拟器在节点 8 上运行。与模拟器交互的代码在节点 12 上运行。我可以看出模拟器正在工作,因为当我多次运行测试代码时,我可以看到文档正在添加到集合中,但我的 onCreate 触发器从未运行。
\n\n这是我的触发器:
\n\nimport * as functions from \'firebase-functions\';\n\nexport const charactersOnCreate = functions.firestore.document(\'characters\').onCreate(() => {\n console.log(\'triggered\');\n})\nRun Code Online (Sandbox Code Playgroud)\n\n这是我的测试代码:
\n\nimport * as dotenv from \'dotenv\';\nimport * as admin from \'firebase-admin\';\nimport * as path from \'path\';\nimport { credential } from \'../config\';\n\ndotenv.config({\n path: path.join(__dirname, \'../../.env.test\')\n});\n\nconsole.log(process.env.FIRESTORE_EMULATOR_HOST);\n\nconst app = admin.initializeApp({ credential });\n\nconst db = app.firestore();\n\nconst runTest = async () => {\n const charactersRef = db.collection(\'characters\');\n const allCharacters = await charactersRef.get()\n allCharacters.forEach(character …Run Code Online (Sandbox Code Playgroud) firebase google-cloud-functions google-cloud-firestore firebase-cli
1. 总结我尝试生成要在 Bitbucket 部署管道中使用的 Firebase 令牌的问题。
我在 GCE VM 上安装了 firebase-tools,但没有在本地 (Windows) 计算机上运行 firebase-tools。
在 GCE VM(我的构建机器)上,我克隆了我的代码。
我安装了 firebase 工具(在 GCE VM 上),然后 cd 到我的代码/存储库。
我跑:firebase init
然后我运行: firebase login:ci,我得到了一个 URL(在 GCE VM 控制台中), [proc@mpi-dev-proc1 bin]$ firebase login:ci
在任何设备上访问此 URL 进行登录:
https://accounts.google.com/o/oauth2/auth?client_id=....
我将其粘贴到 Windows 计算机上的 Web 浏览器中,系统要求我选择一个帐户以继续使用 Firebase CLI。我选择了我的 GCP 帐户。
我看到一个对话框:“Firebase CLI”想要访问您的 Google 帐户...,我点击[允许]
然后我被重定向到本地主机 URL:
http://localhost:9005/?state=445583251...
为什么?
我的本地 Windows 盒子上没有运行服务器,也没有在“localhost”上侦听端口 9005 的任何内容,
为什么我会看到 localhost:9005 的 URL?我不明白,这没有意义。这里应该发生什么?
我正在尝试生成一个 firebase 令牌以在 Bitbucket 构建/部署管道上使用。
2. 提供背景信息,包括您已经尝试过的内容
答: …
我正在尝试根据此处提供的文档使用 firebase CLI 导出和导入用户。我的问题是我还想导出用户声明,或者至少能够在导入用户时包含自定义声明。
基本上要导出我在 CLI 上运行:
firebase auth:export test.json --format=json
Run Code Online (Sandbox Code Playgroud)
为了导入,我在 CLI 上运行:
firebase auth:import test.json \ --hash-algo:scrypt
Run Code Online (Sandbox Code Playgroud)
导出的用户不持有自定义声明信息。
目前,我正在处理 2 个自定义声明,admin 和 access,几乎如此处所述。
问题是我无法在没有返回错误的情况下在文件中包含声明。使用自定义声明导入用户是否可行,如果不可行,正确的程序是什么?
我收到错误“必须在每个“托管”配置中使用“公共”提供公共目录。部署我的 firebase 应用程序时。我该如何解决?
I\xc2\xb4m 尝试将我的代码部署到两个不同的 Firebase 项目,一个用于开发,一个用于生产。
\n\n该my-app-dev项目已包含并正在运行,因此我添加了my-app(用于生产)firebase use --add并选择了my-app.
这就是我的 Firebase 配置现在的样子:
\n\n.firebaserc
\n\n{\n "targets": {\n "my-app-dev": {\n "hosting": {\n "app": [\n "my-app-dev"\n ]\n }\n }\n },\n "projects": {\n "default": "my-app-dev",\n "prod": "my-app"\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n\nfirebase.json
\n\n{\n "hosting": [\n {\n "target": "app",\n "public": "dist/app",\n "ignore": [\n "firebase.json",\n "**/.*",\n "**/node_modules/**"\n ],\n "rewrites": [\n {\n "source": "**",\n "destination": "/index.html"\n }\n ]\n }\n ],\n "functions": {\n "predeploy": [\n "npm --prefix \\"$RESOURCE_DIR\\" run …Run Code Online (Sandbox Code Playgroud)