Search code examples
firebasefirebase-hostingwebsite-hosting

How do I host on Firebase?


I want to host a website in Firebase. I followed the instruction Firebase gave me and there is an instruction says: Add your static files to your deploy directory (the default is public). I don't know what it means, so I just entered the code under this instruction, which is: firebase deploy, and the command prompt responded with: Error: Cannot understand what targets to deploy. Check that you specified valid targets if you used the --only or --except flag. Otherwise, check your firebase.json to ensure that your project is initialized for the desired features. Do I need to create a static file? I don't really know what to do next. The link to the instruction is here: https://console.firebase.google.com/project/example-website/hosting , you need to sign into Google in order to access it.


Solution

  • Try initializing your project with the CLI as explained here: https://firebase.google.com/docs/cli/

    As mentioned there "The init command steps you through setting up your project directory, including asking which Firebase features you want to use." With the features correctly declared you will be able to run firebase deploy without any error