2017-10-06 10 views
6

Próbuję teraz utworzyć samouczek dla mojego Google Home, ale miałem pewne problemy. Zgodnie z this tutorial, zakończyłem następujące kroki realizacji Build.Komenda "Firebase init" nie utworzyła pliku package.json, index.js i folderu funkcji

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 

Ale po kroku 7, było tylko „firebase.json” w bieżącym folderze, więc nie mogłem Patrz Funkcje folderu, package.json i index.js.

Mój log konsoli jest poniżej.

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

Cieszę się, że ktoś mi pomoże. Z góry dzięki.

+0

Czy jesteś absolutnie pewien, że wybrałeś "funkcje"? Powinno to brzmieć "Setup funkcji", a następnie "Katalog funkcji zostanie utworzony w projekcie z wstępnie skonfigurowanym pakietem Node.js . Funkcje mogą być wdrażane przy wdrażaniu firebase." To działa dla mnie. –

+0

Witaj Doug. Po przeczytaniu Twojego komentarza odkryłem, że nie naciskałem tylko spacji. A teraz działa. Dziękuję bardzo za radę. – popo

Odpowiedz

11

Musisz wybrać funkcje, które chcesz zainicjować za pomocą klawiszy strzałek i spacji - żaden z nich nie jest domyślnie włączony. Pojawi się komunikat o błędzie w dzienniku wklejony:

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

Można również uruchomić firebase init functions specjalnie zainicjować tylko funkcje.

+3

Cześć, Michael. Dziękuję za twoją radę. Jak już wspomniałeś, nie naciskałem tylko spacji, aby wybrać funkcje .. :(Teraz wszystko działa. Będę uważniej czytać przewodnik Dzięki! – popo

Powiązane problemy