0

I'm trying to install the Firebase CLI in windows but for some reason it won't allow me to use the "firebase" command anywhere unless I'm in the path C:/Program Files/nodejs. It works fine when I'm in that path, but the whole point of using the command npm install -g firebase-tools is to allow the keyword "firebase" to be globally accessible. So what am I doing wrong? The Firebase docs don't help at all.

The error I'm getting is:

C:\Program Files>firebase -V
C:\Users\David\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\google-auto-auth\index.js:10
class Auth {
^^^^^
SyntaxError: Unexpected reserved word
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\Users\David\AppData\Roaming\npm\node_modules\firebase-tools\lib\requireAuth.js:6:16)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

If i'm in C:/Program Files/nodejs then it works fine:

C:\Program Files\nodejs>firebase -V
3.11.0
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
David Velasquez
  • 2,346
  • 1
  • 26
  • 46
  • Technically, firebase *is* accessible via your shell PATH in both places where you're running it. The first place is just throwing an error when running it from that location. Have you tried uninstalling it and reinstalling it? – Doug Stevenson Sep 18 '17 at 06:17
  • @DougStevenson Figured it out. I had an old version of node installed (0.12) and I had to delete it first, then the new version I just downloaded (6.11) took effect. I wish it said that somewhere in the Node website or Firebase. Happened to find someone else who had a similar problem in a comment on another question here in SO. Spent 2 hours on this stupid problem – David Velasquez Sep 18 '17 at 06:34

0 Answers0