firebase - Firebase Functions 的包锁定部署问题

标签 firebase google-cloud-platform google-cloud-functions

尽管我的 dist 目录中没有 package-lock.json、yarn.lock,但我收到以下错误。我使用 *.tgz 文件作为 monorepo 中的包的工件。该功能过去已成功部署。

{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":3,"message":"Build failed: npm ERR! cipm 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.\nnpm ERR! \nnpm ERR! \nnpm ERR! Invalid: lock file's @mycompany/[email protected] does not satisfy @mycompany/common@file:./mycompany-common-v1.0.0.tgz\nnpm ERR! \n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /www-data-home/.npm/_logs/2022-02-22T10_38_22_819Z-debug.log; Error ID: beaf8772"},"authenticationInfo":{"principalEmail":"[email protected]"},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/my-project/locations/us-central1/functions/nestapi"}

最佳答案

错误表明 package.json 和 package-lock.json 不同步。确保删除node_modules,执行npm install。

‘npm install’会安装依赖项,然后你将拥有一个 package-json.lock 文件,并且 CI 不会抛出任何错误。

或者,您也可以看看这个 GitHub Link .

关于firebase - Firebase Functions 的包锁定部署问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71219915/

相关文章:

firebase - Firestore 订阅可能尚不存在的子集合

node.js - "node"版本 "14"在 WSL 中运行 Node 16 时没有 't match your global version "12"

javascript - 是否可以从父集合(firebase cloud firestore)访问子集合?

javascript - 为什么 export const helloWorld 在 firebase 部署中给出错误,而exports.helloWorld 却没有?

ios - FIrebase 3 查询以返回与子键/值匹配的值

google-cloud-platform - Google Compute Engine 基于 'used' 内存自动缩放

mysql - 错误 : function crashed. 详细信息:连接 ECONNREFUSED/cloudsql/<实例连接名称>>

http - 两个端口号如何同时工作?

javascript - 在 Cloud Firestore onCreate 触发器中运行批处理或事务

firebase - Firebase ImageMagick 的云函数转换 : not found