I followed the following steps:
The Firebase CLI (Command Line Interface) requires Node.js and npm, which you can install by following the instructions on https://nodejs.org/
Once you have Node.js and npm installed, install the Firebase CLI via npm:npm install -g firebase-tools
Initialize your project:
a. Run firebase login
to log in via the browser and authenticate the firebase tool.
b.Go to your Firebase project directory or create the directory
c. Run firebase init functions
Select associated firebase project
Select Y
to install dependencies with npm
Move to directory setup firebase functions
Edit index.js
file with the function you created
Run the firebase use --add
to add your Firebase project
Run firebase deploy --only functions
to deploy the function
After all this I get the message in the terminal at deploy was completed but in the Firebase console, when i click on Functions tab there are no functions listed!?
Running firebase deploy --only functions deletes the existing functions before creating new ones.
You cannot change hosted files in the Firebase Console. Instead, you should change the index. html on your local copy where you initially ran the firebase deploy command. Once you're done with the changes, run firebase deploy again to push the updated version of your website to Firebase Hosting.
Quick Tip: Make sure you are exporting the function you are trying to deploy in your index.js file. Your firebase project will deploy but Cloud Functions won't be available unless they are exported.
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