browserify with firebase+express (Error: Cannot find module 'request')

353 views
Skip to first unread message

Raghav Chandra

unread,
Oct 5, 2013, 10:24:03 PM10/5/13
to fireba...@googlegroups.com
Hey,
I am using browserify with express/nodejs to share a module with the browser itself. For those familiar, all my main.js file has is:

var Firebase = require('firebase');

running browserify main.js gives:
Error: Cannot find module 'request'


I am pretty new to browserify/express, so I could be doing something silly. Am I missing an import somewhere?

Thanks,
Raghav


Chia-liang Kao

unread,
Oct 6, 2013, 6:50:46 AM10/6/13
to fireba...@googlegroups.com
You can't do that.  You should be using the script-include version of firebase when loading firebase into browsers.

Raghav Chandra於 2013年10月6日星期日UTC+8上午10時24分03秒寫道:

Raghav Chandra

unread,
Oct 7, 2013, 5:42:59 AM10/7/13
to fireba...@googlegroups.com
was just using that as an example.
I tried and poked around, and got it working now.

thanks.

Marques Woodson

unread,
Aug 6, 2014, 5:14:14 PM8/6/14
to fireba...@googlegroups.com
I'm getting the same error.  How did you get it working?

Thanks

Jacob Wenger

unread,
Aug 21, 2014, 8:47:25 PM8/21/14
to fireba...@googlegroups.com
Hey everybody,

We just pushed version 1.0.21 of the Firebase npm module which now includes support for browserify. You should be able to just do npm install firebase (make sure you get version 1.0.21 or later) and then require("firebase") and browserify will work. No hacks required!

Jacob
Reply all
Reply to author
Forward
0 new messages