Can't run new firebase in node

MAA

I'm following along with this talk from google. However I can't instantiate a firebase object.

I have a package.json file and started with:

npm install firebase --save

Then did the following:

let Firebase = require('firebase');
let myFire   = new Firebase('[link to my app]');

However, when I run the johhny-five app from terminal, I get the error: Firebase is not a function.

How am I supposed to intstantiate the object? Did Firebase change their API?

Note: I injected it into the repl and running >> typeof Firebase I get that it's actually an 'object'.

Hanuman

Yes, they changed the API, take a look: Upgrade your Web / Node.js app from Firebase.com.

This is how you do it now:

// See https://firebase.google.com/docs/web/setup#project_setup for how to
// auto-generate this config
var config = {
  apiKey: "apiKey",
  authDomain: "projectId.firebaseapp.com",
  databaseURL: "https://databaseName.firebaseio.com"
};

firebase.initializeApp(config);

var rootRef = firebase.database().ref();

To get the config values, go to the URL at the top of the previous code, Add Firebase to your Web Project, which guides you to do the following:

To add Firebase to your app, you'll need a Firebase project and a short snippet of code to add to your application HTML that has a few details about your project.

  1. Create a Firebase project in the Firebase console, if you don't already have one.
    • If you already have an existing Google project associated with your app, click Import Google Project. Otherwise, click Create New Project.
    • If you already have a project, click Add App from the project overview page.
  2. Click Add Firebase to your web app.
  3. Click Copy, then paste the code snippet into your application HTML.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

In the new Firebase console I can't edit the name of nor move nor clone any node of a realtime database

From Dev

Can't run new activity from onPostExecute

From Dev

Jquery function can't run on new elements

From Dev

Can't get node express server to run

From Dev

Can't run globally installed node module

From Dev

new cassandra node can't gossip with seed

From Dev

Can't insert a new node in the binary tree

From Dev

Can't insert a new node in the binary tree

From Dev

Can't get value of node in Firebase

From Dev

Can't allow a new user to run Cassandra nodetool command

From Dev

Sprite kit can't run action before switch to new scene

From Dev

New computer can't run Linux, but runs Windows with no problems

From Dev

Firebase - Can't run tests against standalone test project

From Dev

Can't run js file with node.js on mac

From Dev

can't run a couchbase cluster with more than one node

From Dev

Can't run Node.js app on Heroku

From Dev

can't run docker container with simple node app example in bluemix

From Dev

Can't run npm or any Node Module on Cmder (Windows 7)

From Dev

can't run a couchbase cluster with more than one node

From Dev

Ubuntu can't use node to run mongod database

From Dev

After installation NodeJS, my system can't run node command

From Java

Can't import firebase-admin in Node.js

From Dev

FATAL ERROR: Firebase Queue Issue, can't delete the node

From Dev

How can we copy only the new data items that are added at one node to another node in firebase database

From Dev

New Firebase failed: First argument must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]"

From Dev

Can't run node.js module mdns in node webkit application

From Dev

How can I check if my code will run in a new (or old) version of Node?

From Dev

Xcode Unit Tests - Can't add new test, because it isn't run

From Dev

Can't run maven

Related Related

  1. 1

    In the new Firebase console I can't edit the name of nor move nor clone any node of a realtime database

  2. 2

    Can't run new activity from onPostExecute

  3. 3

    Jquery function can't run on new elements

  4. 4

    Can't get node express server to run

  5. 5

    Can't run globally installed node module

  6. 6

    new cassandra node can't gossip with seed

  7. 7

    Can't insert a new node in the binary tree

  8. 8

    Can't insert a new node in the binary tree

  9. 9

    Can't get value of node in Firebase

  10. 10

    Can't allow a new user to run Cassandra nodetool command

  11. 11

    Sprite kit can't run action before switch to new scene

  12. 12

    New computer can't run Linux, but runs Windows with no problems

  13. 13

    Firebase - Can't run tests against standalone test project

  14. 14

    Can't run js file with node.js on mac

  15. 15

    can't run a couchbase cluster with more than one node

  16. 16

    Can't run Node.js app on Heroku

  17. 17

    can't run docker container with simple node app example in bluemix

  18. 18

    Can't run npm or any Node Module on Cmder (Windows 7)

  19. 19

    can't run a couchbase cluster with more than one node

  20. 20

    Ubuntu can't use node to run mongod database

  21. 21

    After installation NodeJS, my system can't run node command

  22. 22

    Can't import firebase-admin in Node.js

  23. 23

    FATAL ERROR: Firebase Queue Issue, can't delete the node

  24. 24

    How can we copy only the new data items that are added at one node to another node in firebase database

  25. 25

    New Firebase failed: First argument must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]"

  26. 26

    Can't run node.js module mdns in node webkit application

  27. 27

    How can I check if my code will run in a new (or old) version of Node?

  28. 28

    Xcode Unit Tests - Can't add new test, because it isn't run

  29. 29

    Can't run maven

HotTag

Archive