Andrew Schreiber Andrew Schreiber - 4 months ago 259x
Node.js Question

TypeError: Firebase is not a function

I am trying to follow the firebase Node tutorial:

My node.js app is crashing with a "TypeError: Firebase is not a function" error. My index.js file:

var Firebase = require("firebase");
var firebaseRef = new Firebase("");

Line two is where the crash happens.

In my package.json I have:

"firebase": "^3.0.2",


"node": "5.11.0"


It turns out that the tutorial is out-of-date with how the latest firebase package should be used. Below are the new instructions from

In your code, you can access Firebase using:

var firebase = require('firebase');
  apiKey: '<your-api-key>',
  authDomain: '<your-auth-domain>',
  databaseURL: '<your-database-url>',
  storageBucket: '<your-storage-bucket>'

Alternatively, if you setup a Service Account via Permissions in the new Google Firebase dashboard, use the approach referenced in the new official docs here: