小编Oza*_*Oza的帖子

在 firebase 函数中使用 got(npm) 时出现“SyntaxError: Unexpected token *”

我正在使用“得到”作为 api 请求。

在本地运行 firebase 功能时,它运行良好。但是,当我尝试部署时,我收到了"SyntaxError: Unexpected token *"

!  functions[app(us-central1)]: Deployment error.
Function failed on loading user code. Error message: Code in file index.js can't be loaded.
Is there a syntax error in your code?
Detailed stack trace: /srv/node_modules/got/dist/source/create.js:101
    got.paginate = async function* (url, options) {
                                 ^

SyntaxError: Unexpected token *
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17) …
Run Code Online (Sandbox Code Playgroud)

javascript node.js firebase google-cloud-functions

5
推荐指数
1
解决办法
1948
查看次数