得到"SyntaxError:意外令牌=".尝试在Firebase上部署时 [英] Getting "SyntaxError: Unexpected token =" while trying to deploy on firebase

查看:73
本文介绍了得到"SyntaxError:意外令牌=".尝试在Firebase上部署时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试在Firebase上进行部署时,我收到"SyntaxError:Unexpected token =.执行Firebase登录命令时发生错误

I am getting "SyntaxError: Unexpected token =" while trying to deploy on firebase. the error occures when executing firebase login command

C:\ Users \ Jegan \ AppData \ Roaming \ npm \ node_modules \ firebase-tools \ lib \ utils.js:57函数logSuccess(message,type ="info"){^

C:\Users\Jegan\AppData\Roaming\npm\node_modules\firebase-tools\lib\utils.js:57 function logSuccess(message, type = "info") { ^

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)

推荐答案

我通过将nodejs从v4.2.6升级到v8.16.0修复了该问题.您可以运行以下命令:

I fixed that issue by upgrading my nodejs from v4.2.6 to v8.16.0. You can run the following commands :

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

这篇关于得到"SyntaxError:意外令牌=".尝试在Firebase上部署时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆