简体   繁体   中英

Firebase TypeError when trying to initialize

I'm using firebase (the old API), and cant even get the initialization to work. I installed firebase with npm install firebase --save, and all I have in my file is:

var Firebase = require("firebase");

var firebaseRef = new Firebase("https://my-app.firebaseio.com");

And when I run node that-file.js I get:

var firebaseRef = new Firebase("https://my-app.firebaseio.com");
                  ^
TypeError: object is not a function

Did something break when they moved over to the new console? Can i not use the old firebase api anymore?

You're likely on the new version of Firebase. Install the specific version before the 3.0 release.

npm install firebase@2.4.2 --save

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM