28

so, im a newbie in programming and still learning some stuff (i use windows btw)

i try to make an app, connect it to firebase. after setting up everything its time to setting the CLI

good news : i successfully setting up everything from node to nvm untill sucessfully launch the login in CLI.

bad news : right after successfully logn the CLI, im trying to type in the cmd

firebase deploy --only function

and this error appear

Error: not in a Firebase app directory (could not locate firebase.json)

i already search the web for the solution but i found nothing

can someone tell me did i miss something ? thanks.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Raymond Kristanto
  • 547
  • 2
  • 5
  • 7

3 Answers3

48

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.

grmmgrmm
  • 994
  • 10
  • 29
Kevin192291
  • 1,925
  • 4
  • 26
  • 43
5
firebase init

or

firebase init hosting

And then popup question: Set up automatic builds and deploys with GitHub? No enter image description here

BlackBold
  • 61
  • 1
  • 1
1

firebase init didn't work for me, but firebase init hosting did. You can read the firebase hosting initialization docs here.

WhooNo
  • 911
  • 2
  • 12
  • 28