2017-10-06 101 views
6

我正在嘗試爲Google Home創建一個教程應用程序,但我遇到了一些麻煩。根據this tutorial,我完成了構建實現的以下步驟。'Firebase init'命令沒有創建package.json,index.js和函數文件夾

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 

但第7步後,有當前文件夾中唯一的「firebase.json」,所以我看不到文件夾的功能,和的package.json index.js。

我的控制檯日誌如下。

$ 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! 

如果有人幫我,我真的很高興。 在此先感謝。

+0

你絕對肯定你選擇了「功能」?它應該說「功能設置」,然後「將在您的項目中創建一個功能目錄,預先配置了一個Node.js 包。功能可以在Firebase部署中部署。」這對我有用。 –

+0

嗨,道格。在閱讀您的評論後,我發現我不只是按空格鍵。現在它可以工作。非常感謝你的建議。 – popo

回答

11

您必須使用箭頭鍵和空格鍵選擇要初始化的功能 - 默認情況下都不啓用。看到錯誤消息在粘貼的日誌:

⚠ 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. 

您還可以運行firebase init functions專門僅初始化功能。

+3

嗨,邁克爾。感謝您的建議。正如你所說,我不只是按空格鍵來選擇功能.. :(現在一切正常,我會更仔細地閱讀指南 謝謝! – popo