firebase-cli

how to change node version? “Your requested ”node“ version ”8“ doesn't match your global version ”10"

吃可爱长大的小学妹 提交于 2020-06-29 04:27:13
问题 It happen when I run in terminal firebase emulators:start bellow all output i emulators: Starting emulators: functions, hosting ✔ hub: emulator hub started at ht tp://localhost:4400 ⚠ Your requested "node" version "8" doesn't match your global version "10" ✔ functions: functions emulator started at ht tp://localhost:5001 i hosting: Serving hosting files from: dist/spa-mat ✔ hosting: Local server: ht tp://localhost:5000 ✔ hosting: hosting emulator started at http://localhost:5000 i functions:

Login to firebase using gcloud service account

谁都会走 提交于 2020-06-27 18:49:57
问题 I have functions deployed to gcloud functions and i want to configure CI/CD for deploying this functions from gitlab. To do any operations from gitlab i need to get firebase auth token with firebase login:ci command. The problem is that i need to get this token using gcloud service account, which is not displayed in browser, when i run firebase login:ci I have this service account data ( project_id , private_key , private_key_id , etc.) How should i authorize using this acc? 回答1: If you set

Firebase serve --only functions VS local emulator to run cloud functions locally?

╄→гoц情女王★ 提交于 2020-06-24 11:07:12
问题 Up until now I've been doing the following to use and test my functions locally during development: I leave this running in one terminal: firebase serve --only functions And I add this on my client code when I'm initializing my Firebase app: const config = { apiKey: process.env.FIREBASE_APP_API_KEY, authDomain: process.env.FIREBASE_APP_AUTH_DOMAIN, databaseURL: process.env.FIREBASE_APP_DATABASE_URL, projectId: process.env.FIREBASE_APP_PROJECT_ID, storageBucket: process.env.FIREBASE_APP

How to setup test data when testing Firestore Rules with Emulator?

大憨熊 提交于 2020-06-14 06:38:13
问题 I am working on tests for Cloud Firestore Rules, using mocha and Firestore Emulator , and the question is how to initialize some test data before running tests? To test my rules, I first need to initialize some test data. The problem is that I cannot put any data into a document when working with Emulator , documents only have id . I didn't find any example of setting up test data for Rules tests in the docs, so I tried to use both makeDocumentSnapshot from @firebase/testing and document

Firebase function deploying, but not showing up in console

蓝咒 提交于 2020-06-12 05:48:26
问题 This question is essentially the same as question 44799104, only that I provide my index.js (and the only answer there was not helpful, as I do include 'exports'). In short, I have deployed my function successfully, but it does not show in the console. Where am I going wrong? Here is my index.js: const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(functions.config().firebase); var delayInMilliseconds = 5000; exports.copyRoom= functions

Firebase Cloud Functions: “status”:“INVALID_ARGUMENT”

馋奶兔 提交于 2020-06-09 05:49:47
问题 I am locally testing a Firebase Cloud Function. When I call this function using the local URL http://localhost:5001/projectName/us-central1/functionName as described here: exports.createSession = functions.https.onRequest((_req, res) => { res.status(200).send('TESTING'); }); the function works and it returns the string. However, when I call this function: exports.createSession = functions.https.onCall((data, context) => { return 'TESTING'; }); It throws the error: {"error":{"message":"Bad

Update of Firebase CLI to 8.4.0 gives errors about “Unsupported engine” saying '{“node”:“>=10”}'

独自空忆成欢 提交于 2020-05-29 07:43:49
问题 After upgrading to 8.4.0 with npm i -g firebase-tools , the following is shown: npm WARN notsup Unsupported engine for google-auth-library@6.0.0: wanted: {"node":">=10"} (current: {"node":"8.16.2","npm":"6.14.5"}) npm WARN notsup Not compatible with your version of node/npm: google-auth-library@6.0.0 npm WARN notsup Unsupported engine for gaxios@3.0.3: wanted: {"node":">=10"} (current: {"node":"8.16.2","npm":"6.14.5"}) npm WARN notsup Not compatible with your version of node/npm: gaxios@3.0.3

Update of Firebase CLI to 8.4.0 gives errors about “Unsupported engine” saying '{“node”:“>=10”}'

谁说我不能喝 提交于 2020-05-29 07:42:25
问题 After upgrading to 8.4.0 with npm i -g firebase-tools , the following is shown: npm WARN notsup Unsupported engine for google-auth-library@6.0.0: wanted: {"node":">=10"} (current: {"node":"8.16.2","npm":"6.14.5"}) npm WARN notsup Not compatible with your version of node/npm: google-auth-library@6.0.0 npm WARN notsup Unsupported engine for gaxios@3.0.3: wanted: {"node":">=10"} (current: {"node":"8.16.2","npm":"6.14.5"}) npm WARN notsup Not compatible with your version of node/npm: gaxios@3.0.3

Firebase emulator return empty data whereas working fine after deploying

北城余情 提交于 2020-05-15 08:08:13
问题 I have a written a very basic API which will return the services. I tried to run this API in emulator but it return the empty data { "status": "success", "statusCode": 200, "message": "Services retrieved", "data": [] } I have setup the firestore, functions and database emulators. And I am using "firebase-admin": "^8.10.0", "firebase-functions": "^3.6.0" Any idea why the data response is empty ? EDIT This is my method to call the service export const activeServices = functions.https.onRequest(

Firebase emulator return empty data whereas working fine after deploying

こ雲淡風輕ζ 提交于 2020-05-15 08:06:59
问题 I have a written a very basic API which will return the services. I tried to run this API in emulator but it return the empty data { "status": "success", "statusCode": 200, "message": "Services retrieved", "data": [] } I have setup the firestore, functions and database emulators. And I am using "firebase-admin": "^8.10.0", "firebase-functions": "^3.6.0" Any idea why the data response is empty ? EDIT This is my method to call the service export const activeServices = functions.https.onRequest(