'Firebase init'命令没有创建package.json,index.js和函数文件夹

问题描述:

我正在尝试为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

您必须使用箭头键和空格键选择要初始化的功能 - 默认情况下都不启用。看到错误消息在粘贴的日志:

⚠ 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