Skip to content

Instantly share code, notes, and snippets.

Forked from simenbrekken/
Created January 7, 2017 13:44
What would you like to do?
Firebase NPM doesn't expose the token generator dependency

There are some ways to fix this:

  1. Remove dependency and let users install it manually as needed, the token generator isn't really a hard dependency of Firebase anyway
  2. Expose the dependency from the firebase module:
    var Firebase = require('firebase')
        FirebaseTokenGenerator = Firebase.TokenGenerator
$ mkdir firebase-npm-test
$ cd firebase-npm-test
$ npm install firebase
npm http GET
npm http 304
npm http GET
npm http GET
npm http 304
npm http 304
firebase@0.5.0 node_modules/firebase
├── firebase-token-generator@0.1.2
└── faye-websocket@0.4.4
$ node
> require('firebase-token-generator')
Error: Cannot find module 'firebase-token-generator'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at repl:1:2
at REPLServer.self.eval (repl.js:109:21)
at Interface.<anonymous> (repl.js:248:12)
at Interface.EventEmitter.emit (events.js:96:17)
at Interface._onLine (readline.js:200:10)
at Interface._line (readline.js:518:8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment