0

I have setup my firebase cloud functions and CLI correctly and deployed my function for the first time already and all worked fine.

Now that I closed the command prompt and ran it again, firebase does not recognize my project. When I run firebase deploy it give me this Error: "Error: Not in a Firebase app directory (could not locate firebase.json)". Does anyone know how to fix this?

cipano
  • 107
  • 1
  • 8
  • What does your directory structure look like? Are you calling it from the directory above your functions directory? Usually when you call `firebase init` it will link your project and list the different items you want to deploy. I would check your parent directory for a firebase.json folder and if one does not exist, I would then call `firebase init` in the parent directory. (Backup your functions folder first) – Alexander N. Nov 21 '22 at 18:39
  • I have provided an answer below to your question.please check – Sathi Aiswarya Nov 28 '22 at 14:42

1 Answers1

1

Firebase automatically creates your firebase.json file at the root of your project directory when you run the firebase init command.

After logging into firebase with firebase login you will need to do: firebase init and then select the correct options when prompted. be sure to press the space bar to check the functions circle in the command line.you can refer to this link.

firebase login and firebase init will initialize the file firebase.json. Also, run firebase deploy inside the root directory of the project folder where firebase.json lives..

You can follow the video tutorial in this document which might help you.

Sathi Aiswarya
  • 2,068
  • 2
  • 11