尽管我的 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/