Firebase: error: unknown option `--public'

2.6k views Asked by At

I am using this tutorial, after I successfully login to Firebase, I need to set the root dir. So as the tutorial instructs, I run:

~/firebase-webchat$ firebase init --public .

However, I get the following error:

error: unknown option `--public'

Does anyone know what command I should be using?

Thanks

3

There are 3 answers

0
Jakir Hossain On

After updating Node JS, i was able to deploy the project. You can try the same by updating Node JS:

sudo npm install npm@latest -g

Not sure but after updating the node.js, i was able to select project from terminal and able to deploy the project using this commands:

firebase deploy

You can set project from terminal too.

firebase deploy -project your-project-id
0
Paul Jurczyk On

Don't use firebase init --public . -> you're probably following the same tutorial I was. Just use firebase init. You'll get asked to set your public directory later.

=== Hosting Setup Your public directory is the folder (relative to your project directory) that will contain Hosting assets to be uploaded with firebase deploy. If you have a build process for your assets, use your build's output directory. ? What do you want to use as your public directory? .

Hope that helped.

0
Vinicius Lima On

I`ve having the same issue, but i finally get a answer for me.

First of all, do you will net logout from your firbase cli login, so lets run:

$ firebase logout

So thats should logout you.

So next lets login again, but at this time, we will need accept the follow question from firebase cli.

$ firebase login --no-localhost
? Allow Firebase to collect anonymous CLI usage information? Yes

If the ask from firebase not appears, just run

$ firebase login --reauth --no-localhost

So before continue, lets make some improvement on our directory structure, put all your files inside directory called "public"

So to the GRAND FINALE, just run

$ firebase init

I hope help you.