无法部署firebase函数(无法获取未定义的运行服务)

6za6bjd0  于 2022-12-14  发布在  其他
关注(0)|答案(3)|浏览(129)

无法部署firebase函数。我有两个项目别名,第一个项目(dev)工作正常,但第二个项目(prod)就不行了。
每当我写入firebase deploy --only functions时,我都会得到以下消息

i  deploying functions
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
i  artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
+  functions: required API cloudbuild.googleapis.com is enabled
+  artifactregistry: required API artifactregistry.googleapis.com is enabled
+  functions: required API cloudfunctions.googleapis.com is enabled
i  functions: preparing codebase default for deployment
!  functions: package.json indicates an outdated version of firebase-functions. Please upgrade 
using npm install --save firebase-functions@latest in your functions directory.
!  functions: Please note that there will be breaking changes when you upgrade.
i  functions: Loaded environment variables from .env.prod.
!  functions: You are using an old version of firebase-functions SDK (3.15.7). Please update 
firebase-functions SDK to >=3.20.0
i  functions: preparing functions directory for uploading...
i  functions: packaged E:\FlutterProjects\pegasus\functions (218.61 KB) for uploading

Error: Failed to fetch Run service undefined
7y4bm7vi

7y4bm7vi1#

我有同样的问题,它是为我修复时,安装了最新的firebase工具
npm安装-g firebase工具

t9eec4r0

t9eec4r02#

你需要更新你的firebase-tools。运行npm install -g firebase-tools。

4ngedf3f

4ngedf3f3#

通过使用命令npm install -g firebase-tools.升级firebase-tools的版本,也可以自动修复此问题
如果遇到以下错误,可以添加--force标志

npm ERR! code EEXIST
npm ERR! path /usr/local/bin/firebase
npm ERR! EEXIST: file already exists
npm ERR! File exists: /usr/local/bin/firebase

相关问题