我在尝试使用 Firebase CLI 部署 Firebase Functions 时遇到问题。每当我尝试在项目中部署功能时,我都会收到以下错误
Build failed: yarn run v1.22.19
error Command "plugin" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.; Error ID: e83c667d
Build failed: yarn run v1.22.19
error Command "plugin" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.; Error ID: e83c667d
Functions deploy had errors with the following functions:
holderOnCreate(us-central1)
messageOnCreate(us-central1)
i functions: cleaning up build files...
Error: There was an error deploying functions:
1. Error Failed to update function messageOnCreate in region us-central1
2. Error Failed to update function holderOnCreate in region us-central1
我尝试了多种故障排除步骤,包括:
FTR 这里是我在我的机器上安装的纱线和 npm 版本: npm - 9.5.1。纱线 3.5.1 (这很奇怪,因为错误显示了纱线 v1.22.19 行,我根本不知道它来自哪里)
尽管进行了这些尝试,我仍然无法在我的项目中部署 Firebase 功能。
任何人都可以提供有关可能导致此问题的原因的见解或建议吗?任何帮助将不胜感激。
我也有同样的问题。错误中的纱线版本是在谷歌服务器上运行的版本,看起来它已经非常过时了。
我最终删除了我的 firebase 功能项目
yarn.lock
并使用 npm run deploy
进行部署。这最终对我有用。
今天刚遇到这个问题,并遇到了https://cloud.google.com/docs/buildpacks/nodejs#using_yarn,你只需要在package.json中显式指定yarn版本,例如:
"engines": {
"node": "16",
"yarn": ">= 3.6.1"
},
(酌情替换具体版本)