Due to new Firebase Cloud Functions (version > 1.0). I only need to call
admin.initializeApp();
Without any parameters.
However when I did like that then run firebase deploy --only functions , this error occurred :
Failed to read credentials from file G:\projects\ANOTHER_PROJECT\ANOTHER_PROJECT.json: Error: ENOENT: no such file or directory, open 'G:\projects\ANOTHER_PROJECT\ANOTHER_PROJECT.json'
The Firebase CLI creates a .zip archive of the function code, which is then uploaded to a Cloud Storage bucket (prefixed with gcf-sources) in your Firebase project. Cloud Build retrieves the function code and builds the function source.
Using the shell, you mock data and perform function calls to simulate interaction with products that the Local Emulator Suite does not currently support: Cloud Storage, Pub/Sub, Analytics, Remote Config, Storage, Auth, and Crashlytics. The Firebase Test SDK for Cloud Functions, a Node.js with mocha framework for functions development.
Please try again later. Cloud Functions for Firebase is a serverless framework that lets you automatically run backend code in response to events triggered by Firebase features and HTTPS requests. Your JavaScript or TypeScript code is stored in Google's cloud and runs in a managed environment.
You can use the Firebase console to view and search through your logs. Get started setting up, creating, and deploying functions. Learn more about what you can do with functions. Try the Cloud Functions codelab.
I found out the issue was that i had GOOGLE_APPLICATION_CREDENTIALS environment variable defined which was pointing to json file which did not exist and i had long deleted.
I deleted the GOOGLE_APPLICATION_CREDENTIALS env variable. Restarted the terminal and then firebase deploy --only functions worked flawlessly.
In my case, I was adding the " in the path, I was using the windows terminal.
I hope it works for someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With