Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilbunilcho/29b0d0f82b9d191794833c9ed4ababe6 to your computer and use it in GitHub Desktop.
Save ilbunilcho/29b0d0f82b9d191794833c9ed4ababe6 to your computer and use it in GitHub Desktop.
Firebase setup with nodejs 6 on WSL (ubuntu)

uninstall nodejs 8

$ sudo apt purge nodejs
$ sudo apt purge npm
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

install nodejs 6 with nvm

$ nvm ls-remote --lts
$ nvm install v6.14.4
$ cd
$ echo "v6.14.4" > .nvmrc
$ node -v

install yarn (optional, you can use npm)

$ sudo apt install --no-install-recommends yarn

install firebase-tools (yarn or npm, USE ONLY ONE OF THEM)

$ npm -g install firebase-tools
$ yarn global add firebase-tools
$ firebase -V

prepare firebase project

$ mkdir myproject
$ cd myproject
$ firebase login
$ firebase init

go to functions directory and init yarn

$ cd myproject/functions
$ yarn

test local

$ cd myproject
$ firebase serve
=== Serving from 'myproject'...
i functions: Preparing to emulate functions.
i hosting: Serving hosting files from: public
✔ hosting: Local server: http://localhost:5000
✔ functions: test: http://localhost:5001/YOUR_PROJECT/us-central1/YOUR_FUNCTION

open browser for http://localhost:5000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment