0

I installed firebase tools using

sudo npm install -g firebase-tools

and everything seemed to install fine. I already had npm and node.js installed and these are the versions: npm: 2.11.3 node: v0.12.7

But when I try running

firebase init

from my project file, I get this error

    /usr/local/lib/node_modules/firebase-tools/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
const Hoek = require('hoek');
^^^^^
SyntaxError: Use of const in strict mode.
    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> (/usr/local/lib/node_modules/firebase-tools/node_modules/request/node_modules/hawk/lib/index.js:5:33)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

How can I fix this error?

Vanessa Flores
  • 115
  • 1
  • 6

1 Answers1

0

This error is due to Node.js version, you need to update to version 8 or higher.

desoares
  • 861
  • 7
  • 15
  • I ran brew upgrade node and got Error: node 10.0.0 already installed, but when I ran node -v it says v0.12.7. Why is that? – Vanessa Flores Apr 30 '18 at 03:44
  • I'm not particularly proficient on MacOSX. In Ubuntu I use NVM instead of installing Node.JS in apt-get: https://github.com/creationix/nvm – desoares Apr 30 '18 at 03:49
  • Perhaps this may help: https://stackoverflow.com/questions/5056115/how-to-install-latest-version-of-node-using-brew – desoares Apr 30 '18 at 03:50