0

I use crazi_boii@crazi-Boii ~ $ sudo npm install -g firebase-tools to install the cli. and the cmd get executed perfectly.

this is the error i get after typing the command "firebase --version"

/usr/local/lib/node_modules/firebase-tools/node_modules/tar/lib/pack.js:32
const EOF = Buffer.alloc(1024)
                   ^

TypeError: Buffer.alloc is not a function
    at Object.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/tar/lib/pack.js:32:20)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/tar/lib/create.js:6:14)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

pls help. . Thank you

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Crazzi_Boii
  • 624
  • 1
  • 5
  • 9

1 Answers1

0

Cloud Functions for Firebase uses node 6, as stated in the documentation. You're using a much older version, so you'll need to upgrade your node installation. If you don't want to use a package manager to force an upgrade for what you have now, you can install any version of node in your home directory using Node Version Manager.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • I tried to install firebase while using node 12, had the `ERR! grpc@1.20.0 install: node-pre-gyp install --fallback-to-build --library=static_library`, used nvm to downgrade to node 11, now it's working ! – Mario Nezmah Sep 05 '19 at 14:28