You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Firebase云函数部署失败:package.json与package-lock.json不同步问题求助

Firebase云函数部署失败:package.json与package-lock.json不同步问题求助

大家好,我最近在尝试把云函数部署到Google Firebase时一直卡在同一个问题上——我的package.json和package-lock.json文件始终不同步。以下是具体的错误日志:

Build failed: npm ERR! code EUSAGE

npm ERR!

npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.

npm ERR!

npm ERR! Missing: @babel/core@7.22.20 from lock file

npm ERR! Missing: @ampproject/remapping@2.2.1 from lock file

npm ERR! Missing: @babel/helper-compilation-targets@7.22.15 from lock file

npm ERR! Missing: @babel/helper-module-transforms@7.22.20 from lock file

npm ERR! Missing: @babel/helpers@7.22.15 from lock file

npm ERR! Missing: convert-source-map@1.9.0 from lock file

npm ERR! Missing: gensync@1.0.0-beta.2 from lock file

npm ERR! Missing: json5@2.2.3 from lock file

npm ERR! Missing: @babel/compat-data@7.22.20 from lock file

npm ERR! Missing: @babel/helper-validator-option@7.22.15 from lock file

npm ERR! Missing: browserslist@4.21.10 from lock file

npm ERR! Missing: lru-cache@5.1.1 from lock file

npm ERR! Missing: @babel/helper-module-imports@7.22.15 from lock file

npm ERR! Missing: @babel/helper-simple-access@7.22.5 from lock file

npm ERR! Missing: caniuse-lite@1.0.30001538 from lock file

npm ERR! Missing: electron-to-chromium@1.4.525 from lock file

npm ERR! Missing: node-releases@2.0.13 from lock file

npm ERR! Missing: update-browserslist-db@1.0.11 from lock file

npm ERR! Missing: picocolors@1.0.0 from lock file

npm ERR! Missing: yallist@3.1.1 from lock file

npm ERR!

npm ERR! Clean install a project

npm ERR!

npm ERR! Usage:

npm ERR! npm ci

我已经尝试了以下方法,但错误还是没有消失:

  • 删除node_modules文件夹和package-lock.json文件,然后运行npm install,这个操作我在项目根目录和functions目录(我的后端代码所在目录)都执行过
  • 甚至咨询过ChatGPT,但问题依旧没解决

现在我已经卡了两周了,实在不知道还有什么办法可以尝试。有人能告诉我是否应该试试运行npm ci吗?我不太清楚这个命令具体会做什么,希望能得到大家的帮助,谢谢!

Edit1:已经把错误信息从截图改成了文本形式

备注:内容来源于stack exchange,提问作者vroque2022

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.21 12:43:02