1
votes

i am trying to deploy my project on firebase hosting. And whenever i am using firebase init it is showing error in terminal as "firebaserc already has a default project " and it exit with that error

i have tried firebase logout and firebase login again . And used "firebase use" command also to change the project but it is still performing the firebase init action on the default project

i want to remove that default project

3
Please edit the question and copy the text of the terminal output into the question itself. Screenshots of text are difficult to read, and impossible to search with the usual search tools. - Doug Stevenson

3 Answers

4
votes

If you look very carefully at the messaging, it's saying that the name of the file is ".firebaserc" with a leading dot. This file indicates that firebase init was already run in this folder, and the contents of that file describe which project it's connected to (flairboat-48f7b). If you no longer want that file, delete it and start over. Since it starts with a dot, it might be hidden from normal view, but you can be sure that it exists.

1
votes

I ran into the same issue.

Due to a small mistake in setting up the project in firebase, I had to delete it.

But later, I realized that my application NEEDS the default project to be hosted from firebase.

Since I found no shortcuts and running out of time, I did "this" to fix the issue in 10 minutes...with a 5-Step-Process. This is not a "Clever tip". But if you want things up and running soon, you can try this...

  1. Create a new project (in my case, it's React project in VS Code IDE) using - npx create-react-app newprojectname to create a new react project with a different file name.(Don't delete or replace your previous project yet... )

  2. While the new project is being created, create a new project in firebase to host your project.

  3. Copy the folder from your old project that has all your work (it's "src" folder in case of React) and replace the "src" folder in the new project you created in your local machine.

  4. Install all dependencies...Don't forget to add any dependencies you added to you old project. Look at the package.json file of the old project and import all dependencies.

  5. Hit the start command (npm start in my case) and see your project running.

*I'll update if I found some firebase secret to resolve this issue. You can look for the same.

1
votes

you should write: firebase use --add

and it work! You get the option to choose the preject from firebase.