Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Error deploying firebase

akhan_
New Member

When i run 'firebase deploy' in terminal. I get this error:

functions: Unhandled error cleaning up build images. This could result in a small monthly bill if not corrected. 
You can attempt to delete these images by redeploying or you can delete them manually at [link]
I checked my gcf_artifacts, and there are no images there.
I checked the Cloud Logger and this error showed up:
Build failed with status: FAILURE and message: 
npm error code EUSAGE npm error npm error `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 error npm error Missing: tailwindcss@3.4.6 from lock file npm error Missing: @alloc/quick-lru@5.2.0 from lock file

 How can I debug/fix this? Thanks

0 3 790
3 REPLIES 3

Hi @akhan_,

Welcome to Google Cloud Community!

I understand you're experiencing an error when running  firebase deploy. The error message you see in the terminal and Cloud Logger might be related due to a combination of factors, such as your Cloud Function server images, Node Package Manager (NPM),  package dependencies (package.json), lock files (package-lock.json/ npm-shrinkwrap.json), Firebase tools and billing account.

Here are some steps you can take to try and fix the error you're encountering.

  • Follow the instructions in the error message. Run the command below locally, and then redeploy your application. This will update the package-lock.json file, allowing Cloud Build to successfully run npm ci during deployment:
    npm install
  • In some cases, updating your Firebase Tools or using the latest Firebase CLI version can resolve the error you’re encountering. Run the following command to update it:
    npm install -g firebase-tools
  • Check your billing account and current billing charges to see if you have a pending payment for your account.
  • You might find this Stack Overflow link helpful, as it discusses a similar issue.

If you're still encountering problems, I suggest reaching out to Firebase Support for additional support.

I hope the above information is helpful.

Seems that your package.json and package-lock.json are out of sync, you should run `npm install` and commit both of them to your project's repo. You can also run `npm install package@version --save` to fix this, for example, in your case it should be `npm install tailwindcss@3.4.6 @alloc/quick-lru@5.2.0 --save`. Please advise whether it fixed your issue, or provide some more specific info.

I was also facing the same issue, Things were working fine in local but while deploying it was causing error.
In my case i had installed some packages with 
Steps to resolve

 

npm config set legacy-peer-deps false
npm config set legacy-peer-deps false -g
rm -rf node_modules package-lock.json
npm i

 


Note: don't use --force or --legacy-peer-deps, instead downgrade or upgrade the packges to resolve


After this i was able to resolve