Hey Rick,
I want to clear up some confusion here. It seems you are trying to install the actual Firebase node client, so that you can use Firebase in your Node.js application. In that case, when you globally install firebase as Piotr suggested, you WILL NOT have a global firebase command. This is completely expected. I would actually strongly urge against installing the firebase npm module globally as I don't think it makes a whole lot of sense.
Piotr is right on point if he were referring to the firebase-tools npm module, which is completely separate from the firebase npm module. The firebase-tools module provides a global firebase command which is currently mostly for use with our Firebase Hosting product. If you are currently just getting started with our realtime database product, you don't need firebase-tools just yet.
All that being said, if you want to create a Node.js app that uses Firebase (that is, you want to do something like var Firebase = require('firebase')), I would suggest doing the following:
- Create a new directory or go to the directory where your project lives.
- Run npm install firebase --save. You should now have a node_modules/firebase folder in your current working directory which contains all the Firebase stuff you need.
- Create a small JavaScript file (helloworld.js) that uses Firebase and writes to your Firebase (make sure you put in your Firebase name):
var Firebase = require('firebase');
ref.child('rick').set('Hello, World!', function(error) {
if (error === null) {
console.log('Success!');
} else {
console.log('Error:', error);
}
});
Then run the file by running node helloworld.js. If that prints Success!, then you are all set. Visiting your Firebase, you should see the /rick/ node has the value of 'Hello, World'.
If you already installed Firebase globally, I would uninstall it like this:
npm uninstall -g firebase
Sorry if this has been confusing for you. I think you should look into how npm works if you are new to Node + npm.
Here is a pretty decent introductory tutorial. It should clear up a few things for you. But feel free to post back here if you still have questions.
Jacob