Setup Firebase CLI and Initialize Firebase SDK for Cloud Functions
I tried to read the official document to setup firebase in your CLI and soon I got lost. It is very brief so I decided to write my own elaborated version of it. Here it goes
install node and npm then check using
node -v
and npm -v
Once you have Node and npm installed, install the Firebase CLI via npm:
npm install -g firebase-tools
login to firebase
use firebase login
to log in via the browser and authenticate the firebase tool.
if it doesn’t work then use
firebase login --interactive
it will redirect to the browser where you can choose your google account to login to firebase console
Now you setup your project
Use firebase init functions
then press y
to use the current directory to initialize your Firebase projects.
Then comes project setup. Now, using the CLI is tricky. the pointer is at position 1 and it moves down from there.
Press enter to select option-1 Use an existing project
or move down by pressing the down arrow once to create a new project and so on
Choose the language you are comfortable with and the press another y
if you want to use ESLint to catch probable bugs and enforce style?
then you’ll see something like this in your command line
Wrote functions/package.json+ Wrote functions/.eslintrc.json+ Wrote functions/index.js+ Wrote functions/.gitignore? Do you want to install dependencies with npm now? (Y/n) y
After that some more installation and finally you’ll see a message like this
Now when you go to the project directory then you’ll some files created for yor project.
Hope it helps :-)