【发布时间】:2019-11-14 11:46:17
【问题描述】:
我整天都在使用 firebase 成功部署功能,学习如何使用它。我试图看看如果我初始化另一个部署到同一个项目的目录并且在我更新我的 npm 版本之前没有问题会发生什么,现在每当我尝试部署时我都会收到“发生意外错误”
我尝试通过让我自己的用户成为 node_modules、bin 和 share 目录的所有者来更新 npm 权限。我已经尝试卸载并重新安装 firebase-tools。我还尝试删除所有当前的函数目录并初始化一个新目录并在其中重新安装我的依赖项。
这是调试日志
Dylans-MacBook-Pro-3:functions dsenderling$ firebase deploy --debug
[2019-07-03T18:04:35.526Z] ----------------------------------------------------------------------
[2019-07-03T18:04:35.528Z] Command: /usr/local/bin/node /usr/local/bin/firebase deploy --debug
[2019-07-03T18:04:35.529Z] CLI Version: 7.0.2
[2019-07-03T18:04:35.529Z] Platform: darwin
[2019-07-03T18:04:35.529Z] Node Version: v10.16.0
[2019-07-03T18:04:35.529Z] Time: Wed Jul 03 2019 13:04:35 GMT-0500 (Central Daylight Time)
[2019-07-03T18:04:35.529Z] ----------------------------------------------------------------------
[2019-07-03T18:04:35.537Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2019-07-03T18:04:35.537Z] > authorizing via signed-in user
[2019-07-03T18:04:35.537Z] [iam] checking project my-awesome-project-5a4e9 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[2019-07-03T18:04:35.539Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/my-awesome-project-5a4e9:testIamPermissions
permissions=[cloudfunctions.functions.create, cloudfunctions.functions.delete, cloudfunctions.functions.get, cloudfunctions.functions.list, cloudfunctions.functions.update, cloudfunctions.operations.get, firebase.projects.get]
[2019-07-03T18:04:35.769Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Wed, 03 Jul 2019 18:04:35 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=83, alt-svc=quic=":443"; ma=2592000; v="46,43,39", accept-ranges=none, transfer-encoding=chunked
[2019-07-03T18:04:37.033Z] TypeError: Cannot read property 'wanted' of undefined
at /usr/local/lib/node_modules/firebase-tools/lib/checkFirebaseSDKVersion.js:37:51
at process._tickCallback (internal/process/next_tick.js:68:7)
Error: An unexpected error has occurred.
我的直觉告诉我 firebase-tools 或我的 firebase sdk 有问题,但我不知道是什么问题。提前致谢
【问题讨论】:
-
我浏览了很多关于外观相似的 TypeErrors 的帖子,但不幸的是,我找不到任何似乎与我的原因相同的帖子。我已经尝试解决的问题主要来自这里的其他帖子。
-
尝试将 f
firebase-tools更新到 7.1.1,它对我有用
标签: node.js firebase google-cloud-functions firebase-cli