【问题标题】:Getting "SyntaxError: Unexpected token =" while trying to deploy on firebase尝试在 Firebase 上部署时出现“SyntaxError: Unexpected token =”
【发布时间】:2019-04-27 22:55:52
【问题描述】:

我在尝试在 firebase 上部署时收到“SyntaxError: Unexpected token =”。 执行firebase登录命令时出现错误

C:\Users\Jegan\AppData\Roaming\npm\node_modules\firebase-tools\lib\utils.js:57 功能日志成功(消息,类型=“信息”){ ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (C:\Users\Jegan\AppData\Roaming\npm\node_modules\fireb
ase-tools\lib\command.js:5:13)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

【问题讨论】:

    标签: firebase npm web-applications hosting


    【解决方案1】:

    我通过将我的 nodejs 从 v4.2.6 升级到 v8.16.0 解决了这个问题。 您可以运行以下命令:

    sudo apt-get update
    sudo apt-get install curl
    curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
    sudo apt-get install nodejs
    node --version
    

    【讨论】:

      【解决方案2】:

      我通过更新我的 Node 版本解决了这个问题。

      【讨论】:

      • 什么节点版本?
      猜你喜欢
      • 2021-01-22
      • 2018-10-22
      • 1970-01-01
      • 2021-01-10
      • 1970-01-01
      • 2017-04-17
      • 1970-01-01
      • 2018-12-15
      • 1970-01-01
      相关资源
      最近更新 更多