Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Firebase init' command didn't create package.json, index.js and function folder

I’m now trying to create a tutorial app for my Google Home but I faced some trouble. According to this tutorial, I finished following steps of Build fulfillment.

1.Download and install Node.js.
2.npm install -g firebase-tools
3.firebase login
4-1.mkdir sillynamemaker
4-2.cd sillynamemaker
4-3.firebase init
5.select Functions:…
6.select action project(silllynamemaker-***)
7.firebase init

But after step 7, there were only ‘firebase.json’ in current folder, so I couldn’t see functions folder, package.json and index.js.

My console log is below.

$ node -v
v8.6.0
$ npm --version
5.3.0
$ firebase --version
3.13.1

$ firebase init
You're about to initialize a Firebase project in this directory: ~/ghome/sillynamemaker

? Which Firebase CLI features do you want to setup for this folder? Press Space to select features, then Enter to confirm your choices. 
⚠  You have have not selected any features. Continuing will simply associate this folder with a Firebase project. Press Ctrl + C if you want to start over.

=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add, 
but for now we'll just set up a default project.

? Select a default Firebase project for this directory: SillyNameMaker (sillynamemaker-*****)

i  Writing configuration info to firebase.json...
i  Writing project information to .firebaserc...

✔  Firebase initialization complete!

I'm really glad if someone help me. Thanks in advance.

like image 216
popo Avatar asked Oct 06 '17 16:10

popo


People also ask

What is the firebase JSON file?

The firebase.json file. The firebase init command creates a firebase.json configuration file in the root of your project directory. The firebase.json file is required to deploy assets with the Firebase CLI because it specifies which files and settings from your project directory are deployed to your Firebase project.

What does the firebase INIT command do?

The firebase init command steps you through setting up your project directory and some Firebase products. During project initialization, the Firebase CLI asks you to: Select desired Firebase products then prompts you to set configurations for specific files for the selected products.

How do I deploy to a firebase project?

Deploy to a Firebase project. The Firebase CLI manages deployment of code and assets to your Firebase project, including: To deploy to a Firebase project, run the following command from your project directory: By default, firebase deploy creates a release for all deployable resources in your project directory.

How do I change the project ID for my Firebase project?

Firebase generates a unique ID for your Firebase project based upon the name you give it. If you want to edit this project ID, you must do it now as it cannot be altered after Firebase provisions resources for your project. Visit Understand Firebase Projects to learn about how Firebase uses the project ID.


1 Answers

You must select features you want to initialize by using the arrow keys and spacebar -- none are on by default. See the error message in your pasted log:

⚠  You have have not selected any features. Continuing will simply associate this folder with a Firebase project. Press Ctrl + C if you want to start over.

You can also run firebase init functions to specifically initialize only functions.

like image 150
Michael Bleigh Avatar answered Nov 15 '22 09:11

Michael Bleigh