How do you verify install is correct?

983 views
Skip to first unread message

Rick Mason

unread,
Nov 29, 2014, 7:26:52 PM11/29/14
to fireba...@googlegroups.com
I am running Windows 7 with a fresh install of both Nodejs and NPM.  My first attempt failed with $ as an unrecognized character.  So I removed it and received a message that I cannot decipher.  I checked my NPM modules directory and I don't see a Firebase directory.  I've attached a screen grab below:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\windows\system32>$ npm install firebase --save
'$' is not recognized as an internal or external command,
operable program or batch file.

C:\windows\system32>npm install firebase --save
fire...@2.0.5 node_modules\firebase
└── faye-we...@0.8.1 (websocke...@0.4.0)

C:\windows\system32>

Do I correctly have Firebase installed?  If so, where do the files reside?

Thanks,

Rick


Jacob Wenger

unread,
Nov 30, 2014, 6:31:56 PM11/30/14
to fireba...@googlegroups.com
Hey Rick,

The reason you got the "'$' is not recognized as an internal or external command" is because you have an extraneous $ in front of your npm install command. The second time you ran the command, you correctly dropped the $. You probably copied that from our documentation. We include the $ since that is a common programming terminology that the command should be run via the command prompt.

It looks like Firebase installed fine the second time you tried it. You can find the files from the same directory you ran the npm install command by running the following from the command line:

ls node_modules/firebase

Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/93024f4c-fa7a-4c42-a71a-f8d1922845a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Piotr Kaminski

unread,
Nov 30, 2014, 6:32:42 PM11/30/14
to fireba...@googlegroups.com
Hi Rick,

The leading "$" is not meant to be typed in; it's used to indicate that the line is meant to be entered in a shell, because on Unix systems "$" is typically the prompt character (just like ">" is the prompt character in Windows).  You should just leave it out.  Even better, I recommend that you install git for Windows (http://git-scm.com/download/win) and use the "Git Bash" shell instead of the Windows command prompt -- a lot of command-line-centric tutorials will go more smoothly that way.

Your second command executed successfully but probably didn't do what you intended: it installed firebase in c:\windows\system32\node_modules\firebase and created a package.json file in c:\windows\system32.  You would normally use that style of installation only within a project, not for a global command-line tool.  I recommend that you clean up this directory and file and instead run:

npm install --global firebase

You should then be able to confirm that it installed correctly by running this command from any prompt:

firebase --version

Good luck!

    -- P.


On Sat, Nov 29, 2014 at 4:26 PM, Rick Mason <rhm...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/93024f4c-fa7a-4c42-a71a-f8d1922845a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
  Piotr Kaminski <pi...@ideanest.com>
  "That bun is dirty.  Don't eat that bun."

Rick Mason

unread,
Dec 1, 2014, 1:48:26 AM12/1/14
to fireba...@googlegroups.com
Piotr,

What you said made perfect sense but then I tried it without success.  Here's what I typed:

C:\>npm install --global firebase
fire...@2.0.5 C:\Users\Rick\AppData\Roaming\npm\node_modules\firebase
└── faye-we...@0.8.1 (websocke...@0.4.0)

C:\>firebase --version
'firebase' is not recognized as an internal or external command,
operable program or batch file.

This time after much searching I found out that 'global' installed Firebase in \users\Rick\appdata\roaming\node_modules\

Sorry but I just didn't see that coming ;).  Shouldn't Firebase with a 'global' install be located here:

C:\Program Files\nodejs\node_modules\?? Firebase ??

Do I need to install it globally while in the nodejs directory???  Also what advantages does the Git Bash Shell add other than possibly adding the $ prompt?

Thanks for your help,

Rick


Piotr Kaminski

unread,
Dec 1, 2014, 2:01:49 AM12/1/14
to fireba...@googlegroups.com
Hi Rick,

Yup, that's the correct location -- global installs can be run from anywhere.  You should also have 'firebase' and 'firebase.cmd' scripts in \users\Rick\appdata\roaming\npm.  Did you restart your machine after installing node/npm?  The installation added  the npm scripts directory to your system PATH, and I seem to recall that the Windows command prompt doesn't pick up the change without a restart.

I recommend the bash shell (or anything other than the command prompt, really) because you run into far fewer issues like these.  It also comes with a full complement of Unix commands, which is useful when following various tutorials, has decent history and editing capabilities, not to mention a halfway reasonable scripting language.  If you haven't used a Unix shell before it's a bit of a learning curve, but I can't imagine being a developer without having some mastery of the shell.  (With the caveat that if you're on the Microsoft / .NET side of the world, you'll probably invest in learning PowerShell instead.)

But if all you want is to be able to run the firebase command, then a reboot and the command prompt should be fine.  :)

    -- P.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jacob Wenger

unread,
Dec 1, 2014, 2:57:36 AM12/1/14
to fireba...@googlegroups.com
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:
  1. Create a new directory or go to the directory where your project lives.
  2. 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.
  3. 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');

var ref = new Firebase('https://<your-firebase>.firebaseio.com');
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

Rick Mason

unread,
Dec 1, 2014, 2:59:37 AM12/1/14
to fireba...@googlegroups.com
Piotr,

Tried a reboot and still not able to get the firebase command recognized. I took a look at my environmental variables.   I can see nodejs in the path under system variables and there's a path statement under user variables that points to the firebase install in the users directory.

Got any other suggestions for me?


Rick


Piotr Kaminski

unread,
Dec 1, 2014, 5:12:16 AM12/1/14
to fireba...@googlegroups.com
Hi Rick,

Sorry, I got confused between firebase and firebase-tools.  You should follow Jacob's latest suggestions.

    -- P.


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages