Reputation: 217
I receive a following error despite no package-lock.json, yarn.lock in my dist directory. I use *.tgz files as artifacts of packages in a monorepo. This function was successfully deployed in the past.
{"@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"}
Upvotes: 2
Views: 2192
Reputation: 643
The error indicated package.json and package-lock.json are not in sync. Make sure to remove node_modules, execute npm install.
‘npm install’ would install the dependencies, then you'll have a package-json.lock file and CI won't throw any error.
Alternatively, you may also have a look at this GitHub Link.
Upvotes: 2