firebase-tools: Error on firebase deploy for version 3.17.6

Version info

3.17.6

Platform Information

LINUX

Steps to reproduce

Run $ firebase use --token $FIREBASE_DEPLOY_KEY

Error:

/usr/local/lib/node_modules/firebase-tools/node_modules/sntp/lib/index.js:19
exports.time = async function (options = {}) {
                     ^^^^^^^^
SyntaxError: Unexpected token function
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/hawk/lib/index.js:5:16)
    at Module._compile (module.js:570:32)

Expected behavior

Deploy project to firebase host

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 15 (5 by maintainers)

Commits related to this issue

Most upvoted comments

@laurenzlong guess because node 8 is in LTS for a really long time and people use it as default environment on their machines. Any information on when cloud functions will switch to node 8?

@MehranJanfeshan try to deploy a really simple function which will output version of the node on you cloud functions

const version = https.onRequest('/version', (req, res) => {
  res.send(process.version)
})
module.exports = {
  version
}

This way you will know for sure on what version of node you are running.

BTW, you can borrow some ideas of transforming modern es syntax into node 6 compatible from my helper util - https://github.com/Rulsky/cra-firebase